@teambit/checkout 0.0.222 → 0.0.224
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout-cmd.d.ts +1 -3
- package/dist/checkout-cmd.js +1 -18
- package/dist/checkout-cmd.js.map +1 -1
- package/dist/checkout-version.d.ts +75 -0
- package/dist/checkout-version.js +267 -0
- package/dist/checkout-version.js.map +1 -0
- package/dist/checkout.main.runtime.js +14 -7
- package/dist/checkout.main.runtime.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/package-tar/teambit-checkout-0.0.224.tgz +0 -0
- package/package.json +10 -10
- package/package-tar/teambit-checkout-0.0.222.tgz +0 -0
- /package/dist/{preview-1683776045298.js → preview-1683928154685.js} +0 -0
package/dist/checkout-cmd.d.ts
CHANGED
|
@@ -15,16 +15,14 @@ export declare class CheckoutCmd implements Command {
|
|
|
15
15
|
options: CommandOptions;
|
|
16
16
|
loader: boolean;
|
|
17
17
|
constructor(checkout: CheckoutMain);
|
|
18
|
-
report([to, componentPattern]: [string, string], { interactiveMerge, ours, theirs, manual,
|
|
18
|
+
report([to, componentPattern]: [string, string], { interactiveMerge, ours, theirs, manual, all, workspaceOnly, verbose, skipDependencyInstallation, }: {
|
|
19
19
|
interactiveMerge?: boolean;
|
|
20
20
|
ours?: boolean;
|
|
21
21
|
theirs?: boolean;
|
|
22
22
|
manual?: boolean;
|
|
23
|
-
reset?: boolean;
|
|
24
23
|
all?: boolean;
|
|
25
24
|
workspaceOnly?: boolean;
|
|
26
25
|
verbose?: boolean;
|
|
27
|
-
skipNpmInstall?: boolean;
|
|
28
26
|
skipDependencyInstallation?: boolean;
|
|
29
27
|
}): Promise<string>;
|
|
30
28
|
}
|
package/dist/checkout-cmd.js
CHANGED
|
@@ -21,13 +21,6 @@ function _chalk() {
|
|
|
21
21
|
};
|
|
22
22
|
return data;
|
|
23
23
|
}
|
|
24
|
-
function _bitError() {
|
|
25
|
-
const data = require("@teambit/bit-error");
|
|
26
|
-
_bitError = function () {
|
|
27
|
-
return data;
|
|
28
|
-
};
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
24
|
function _merging() {
|
|
32
25
|
const data = require("@teambit/merging");
|
|
33
26
|
_merging = function () {
|
|
@@ -69,7 +62,7 @@ class CheckoutCmd {
|
|
|
69
62
|
\`bit checkout latest [component-pattern]\` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all
|
|
70
63
|
\`bit checkout reset [component-pattern]\` => remove local modifications from the specified ids (or all components when --all is used)`);
|
|
71
64
|
(0, _defineProperty2().default)(this, "alias", 'U');
|
|
72
|
-
(0, _defineProperty2().default)(this, "options", [['i', 'interactive-merge', 'when a component is modified and the merge process found conflicts, display options to resolve them'], ['o', 'ours', 'in case of a conflict, override the used version with the current modification'], ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['r', 'reset', 'revert changes that were not snapped/tagged'], ['a', 'all', 'all components'], ['e', 'workspace-only', 'when on a lane, avoid introducing new components from the remote lane that do not exist locally'], ['v', 'verbose', 'showing verbose output for inspection'], ['
|
|
65
|
+
(0, _defineProperty2().default)(this, "options", [['i', 'interactive-merge', 'when a component is modified and the merge process found conflicts, display options to resolve them'], ['o', 'ours', 'in case of a conflict, override the used version with the current modification'], ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['r', 'reset', 'revert changes that were not snapped/tagged'], ['a', 'all', 'all components'], ['e', 'workspace-only', 'when on a lane, avoid introducing new components from the remote lane that do not exist locally'], ['v', 'verbose', 'showing verbose output for inspection'], ['x', 'skip-dependency-installation', 'do not install packages of the imported components']]);
|
|
73
66
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
74
67
|
}
|
|
75
68
|
async report([to, componentPattern], {
|
|
@@ -77,21 +70,11 @@ class CheckoutCmd {
|
|
|
77
70
|
ours = false,
|
|
78
71
|
theirs = false,
|
|
79
72
|
manual = false,
|
|
80
|
-
reset = false,
|
|
81
73
|
all = false,
|
|
82
74
|
workspaceOnly = false,
|
|
83
75
|
verbose = false,
|
|
84
|
-
skipNpmInstall = false,
|
|
85
76
|
skipDependencyInstallation = false
|
|
86
77
|
}) {
|
|
87
|
-
if (reset) {
|
|
88
|
-
throw new (_bitError().BitError)(`--reset flag has been removed. please run "bit checkout reset" instead`);
|
|
89
|
-
}
|
|
90
|
-
if (skipNpmInstall) {
|
|
91
|
-
// eslint-disable-next-line no-console
|
|
92
|
-
console.log(_chalk().default.yellow(`"--skip-npm-install" has been deprecated, please use "--skip-dependency-installation" instead`));
|
|
93
|
-
skipDependencyInstallation = true;
|
|
94
|
-
}
|
|
95
78
|
const checkoutProps = {
|
|
96
79
|
promptMergeOptions: interactiveMerge,
|
|
97
80
|
mergeStrategy: (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual),
|
package/dist/checkout-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","ours","theirs","manual","reset","all","workspaceOnly","verbose","skipNpmInstall","skipDependencyInstallation","BitError","console","log","chalk","yellow","checkoutProps","promptMergeOptions","mergeStrategy","getMergeStrategy","isLane","components","version","failedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","checkoutByCLIValues","isHead","isReset","isLatest","realFailedComponents","filter","f","unchangedLegitimately","notCheckedOutComponents","getFailureOutput","length","title","body","map","failedComponent","bold","id","toString","red","failureMessage","join","underline","getNotCheckedOutOutput","green","getConflictSummary","suggestion","conflictSummaryReport","getSuccessfulOutput","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","componentsStr","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","failedToCheckOut","newLines","checkedOutStr","unchangedLegitimatelyStr","failedToCheckOutStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'docs/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n \\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n \\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag, omit [component-pattern] to checkout head for all\n \\`bit checkout latest [component-pattern]\\` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all\n \\`bit checkout reset [component-pattern]\\` => remove local modifications from the specified ids (or all components when --all is used)`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n ['o', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['r', 'reset', 'revert changes that were not snapped/tagged'],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n 'when on a lane, avoid introducing new components from the remote lane that do not exist locally',\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['', 'reset', 'DEPRECATED. run \"bit checkout reset\" instead'],\n ['', 'skip-npm-install', 'DEPRECATED. use \"--skip-dependency-installation\" instead'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n ours = false,\n theirs = false,\n manual = false,\n reset = false,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipNpmInstall = false,\n skipDependencyInstallation = false,\n }: {\n interactiveMerge?: boolean;\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n reset?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n skipDependencyInstallation?: boolean;\n }\n ) {\n if (reset) {\n throw new BitError(`--reset flag has been removed. please run \"bit checkout reset\" instead`);\n }\n if (skipNpmInstall) {\n // eslint-disable-next-line no-console\n console.log(\n chalk.yellow(`\"--skip-npm-install\" has been deprecated, please use \"--skip-dependency-installation\" instead`)\n );\n skipDependencyInstallation = true;\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: getMergeStrategy(ours, theirs, manual),\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n };\n const {\n components,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = await this.checkout.checkoutByCLIValues(to, componentPattern || '', checkoutProps);\n const isHead = to === 'head';\n const isReset = to === 'reset';\n const isLatest = to === 'latest';\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = (failedComponents || []).filter((f) => f.unchangedLegitimately);\n\n const getFailureOutput = () => {\n if (!realFailedComponents.length) return '';\n const title = 'the checkout has been failed on the following component(s)';\n const body = realFailedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage)}`\n )\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'the checkout was not needed on the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.failureMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\" and \"bit compile\".\nonce ready, snap/tag the components to persist the changes`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n if (components.length === 1) {\n const component = components[0];\n const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (isReset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title = `successfully switched ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !isReset\n isHead || isLatest ? component.id.version : version\n )}\\n`;\n return `${chalk.underline(title)} ${applyVersionReport(components, false)}`;\n }\n if (isReset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (isHead) return 'their head version';\n if (isLatest) return 'their latest version';\n // @ts-ignore version is defined when !isReset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title = `successfully switched the following components to ${versionOutput}\\n\\n`;\n const showVersion = isHead || isReset;\n const componentsStr = applyVersionReport(components, true, showVersion);\n return chalk.underline(title) + componentsStr;\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components introduced on the lane and were not added. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const failedToCheckOut = realFailedComponents.length;\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Checkout Summary');\n const checkedOutStr = `\\nTotal CheckedOut: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const failedToCheckOutStr = `\\nTotal Failed: ${chalk.bold(failedToCheckOut.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return newLines + title + checkedOutStr + unchangedLegitimatelyStr + failedToCheckOutStr + newOnLaneStr;\n };\n\n return (\n getFailureOutput() +\n getNotCheckedOutOutput() +\n getSuccessfulOutput() +\n getNewOnLaneOutput() +\n getConflictSummary() +\n getSummary() +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IA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AAI,uBAAsBzD,gBAAK,CAAC8B,IAAI,CAACuB,UAAU,CAACrB,QAAQ,EAAE,CAAE,EAAC;MAChF,MAAM0B,wBAAwB,GAAI,sBAAqB1D,gBAAK,CAAC8B,IAAI,CAACwB,yBAAyB,CAACtB,QAAQ,EAAE,CAAE,EAAC;MACzG,MAAM2B,mBAAmB,GAAI,mBAAkB3D,gBAAK,CAAC8B,IAAI,CAACyB,gBAAgB,CAACvB,QAAQ,EAAE,CAAE,EAAC;MACxF,MAAM4B,YAAY,GAAG,CAAAjD,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEc,MAAM,KAAI,CAAC;MAC7C,MAAMoC,iBAAiB,GAAGjD,gBAAgB,GAAG,UAAU,GAAG,cAAc;MACxE,MAAMkD,YAAY,GAAGF,YAAY,GAC5B,gBAAeC,iBAAkB,KAAI7D,gBAAK,CAAC8B,IAAI,CAAC8B,YAAY,CAAC5B,QAAQ,EAAE,CAAE,EAAC,GAC3E,EAAE;MAEN,OAAOwB,QAAQ,GAAG9B,KAAK,GAAG+B,aAAa,GAAGC,wBAAwB,GAAGC,mBAAmB,GAAGG,YAAY;IACzG,CAAC;IAED,OACEtC,gBAAgB,EAAE,GAClBa,sBAAsB,EAAE,GACxBK,mBAAmB,EAAE,GACrBS,kBAAkB,EAAE,GACpBZ,kBAAkB,EAAE,GACpBa,UAAU,EAAE,GACZ,IAAAW,kCAAuB,EAAClD,iBAAiB,CAAC,GAC1C,IAAAmD,iCAAsB,EAAClD,gBAAgB,CAAC;EAE5C;AACF;AAAC"}
|
|
1
|
+
{"version":3,"names":["CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","ours","theirs","manual","all","workspaceOnly","verbose","skipDependencyInstallation","checkoutProps","promptMergeOptions","mergeStrategy","getMergeStrategy","isLane","skipNpmInstall","components","version","failedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","checkoutByCLIValues","isHead","isReset","isLatest","realFailedComponents","filter","f","unchangedLegitimately","notCheckedOutComponents","getFailureOutput","length","title","body","map","failedComponent","chalk","bold","id","toString","red","failureMessage","join","underline","getNotCheckedOutOutput","green","getConflictSummary","suggestion","conflictSummaryReport","yellow","getSuccessfulOutput","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","componentsStr","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","failedToCheckOut","newLines","checkedOutStr","unchangedLegitimatelyStr","failedToCheckOutStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'docs/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n \\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n \\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag, omit [component-pattern] to checkout head for all\n \\`bit checkout latest [component-pattern]\\` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all\n \\`bit checkout reset [component-pattern]\\` => remove local modifications from the specified ids (or all components when --all is used)`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n ['o', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['r', 'reset', 'revert changes that were not snapped/tagged'],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n 'when on a lane, avoid introducing new components from the remote lane that do not exist locally',\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n ours = false,\n theirs = false,\n manual = false,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n }: {\n interactiveMerge?: boolean;\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n }\n ) {\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: getMergeStrategy(ours, theirs, manual),\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n };\n const {\n components,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = await this.checkout.checkoutByCLIValues(to, componentPattern || '', checkoutProps);\n const isHead = to === 'head';\n const isReset = to === 'reset';\n const isLatest = to === 'latest';\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = (failedComponents || []).filter((f) => f.unchangedLegitimately);\n\n const getFailureOutput = () => {\n if (!realFailedComponents.length) return '';\n const title = 'the checkout has been failed on the following component(s)';\n const body = realFailedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage)}`\n )\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'the checkout was not needed on the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.failureMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\" and \"bit compile\".\nonce ready, snap/tag the components to persist the changes`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n if (components.length === 1) {\n const component = components[0];\n const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (isReset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title = `successfully switched ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !isReset\n isHead || isLatest ? component.id.version : version\n )}\\n`;\n return `${chalk.underline(title)} ${applyVersionReport(components, false)}`;\n }\n if (isReset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (isHead) return 'their head version';\n if (isLatest) return 'their latest version';\n // @ts-ignore version is defined when !isReset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title = `successfully switched the following components to ${versionOutput}\\n\\n`;\n const showVersion = isHead || isReset;\n const componentsStr = applyVersionReport(components, true, showVersion);\n return chalk.underline(title) + componentsStr;\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components introduced on the lane and were not added. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const failedToCheckOut = realFailedComponents.length;\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Checkout Summary');\n const checkedOutStr = `\\nTotal CheckedOut: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const failedToCheckOutStr = `\\nTotal Failed: ${chalk.bold(failedToCheckOut.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return newLines + title + checkedOutStr + unchangedLegitimatelyStr + failedToCheckOutStr + newOnLaneStr;\n };\n\n return (\n getFailureOutput() +\n getNotCheckedOutOutput() +\n getSuccessfulOutput() +\n getNewOnLaneOutput() +\n getConflictSummary() +\n getSummary() +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,WAAW,CAAoB;EA2C1CC,WAAW,CAASC,QAAsB,EAAE;IAAA,K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,CAAC7B,QAAQ,EAAE,CAAE,EAAC,GAC3E,EAAE;MAEN,OAAOyB,QAAQ,GAAGhC,KAAK,GAAGiC,aAAa,GAAGC,wBAAwB,GAAGC,mBAAmB,GAAGG,YAAY;IACzG,CAAC;IAED,OACExC,gBAAgB,EAAE,GAClBc,sBAAsB,EAAE,GACxBM,mBAAmB,EAAE,GACrBS,kBAAkB,EAAE,GACpBb,kBAAkB,EAAE,GACpBc,UAAU,EAAE,GACZ,IAAAW,kCAAuB,EAACpD,iBAAiB,CAAC,GAC1C,IAAAqD,iCAAsB,EAACpD,gBAAgB,CAAC;EAE5C;AACF;AAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Consumer } from '@teambit/legacy/dist/consumer';
|
|
2
|
+
import { BitId } from '@teambit/legacy-bit-id';
|
|
3
|
+
import Version from '@teambit/legacy/dist/scope/models/version';
|
|
4
|
+
import { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';
|
|
5
|
+
import { ApplyVersionResult, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
|
|
6
|
+
import { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
|
|
7
|
+
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
|
|
8
|
+
export declare type CheckoutProps = {
|
|
9
|
+
version?: string;
|
|
10
|
+
ids?: BitId[];
|
|
11
|
+
latestVersion?: boolean;
|
|
12
|
+
promptMergeOptions?: boolean;
|
|
13
|
+
mergeStrategy?: MergeStrategy | null;
|
|
14
|
+
verbose?: boolean;
|
|
15
|
+
skipNpmInstall?: boolean;
|
|
16
|
+
ignorePackageJson?: boolean;
|
|
17
|
+
writeConfig?: boolean;
|
|
18
|
+
reset?: boolean;
|
|
19
|
+
all?: boolean;
|
|
20
|
+
ignoreDist?: boolean;
|
|
21
|
+
isLane?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare type ComponentStatus = {
|
|
24
|
+
componentFromFS?: ConsumerComponent;
|
|
25
|
+
componentFromModel?: Version;
|
|
26
|
+
id: BitId;
|
|
27
|
+
failureMessage?: string;
|
|
28
|
+
unchangedLegitimately?: boolean;
|
|
29
|
+
mergeResults?: MergeResultsThreeWay | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
declare type ApplyVersionWithComps = {
|
|
32
|
+
applyVersionResult: ApplyVersionResult;
|
|
33
|
+
component?: ConsumerComponent;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 1) when the files are modified with conflicts and the strategy is "ours", leave the FS as is
|
|
37
|
+
* and update only bitmap id version. (not the componentMap object).
|
|
38
|
+
*
|
|
39
|
+
* 2) when the files are modified with conflicts and the strategy is "theirs", write the component
|
|
40
|
+
* according to id.version.
|
|
41
|
+
*
|
|
42
|
+
* 3) when files are modified with no conflict or files are modified with conflicts and the
|
|
43
|
+
* strategy is manual, load the component according to id.version and update component.files.
|
|
44
|
+
* applyModifiedVersion() docs explains what files are updated/added.
|
|
45
|
+
*
|
|
46
|
+
* 4) when --reset flag is used, write the component according to the bitmap version
|
|
47
|
+
*
|
|
48
|
+
* Side note:
|
|
49
|
+
* Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).
|
|
50
|
+
* Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles
|
|
51
|
+
*/
|
|
52
|
+
export declare function applyVersion(consumer: Consumer, id: BitId, componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true
|
|
53
|
+
mergeResults: MergeResultsThreeWay | null | undefined, checkoutProps: CheckoutProps): Promise<ApplyVersionWithComps>;
|
|
54
|
+
/**
|
|
55
|
+
* relevant only when
|
|
56
|
+
* 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.
|
|
57
|
+
* 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.
|
|
58
|
+
*
|
|
59
|
+
* this function only updates the files content, it doesn't write the files
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyModifiedVersion(componentFiles: SourceFile[], mergeResults: MergeResultsThreeWay, mergeStrategy: MergeStrategy | null | undefined): {
|
|
62
|
+
filesStatus: Record<string, any>;
|
|
63
|
+
modifiedFiles: SourceFile[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* when files exist on the filesystem but not on the checked out versions, they need to be deleted.
|
|
67
|
+
* this function only mark them as such. later `deleteFilesIfNeeded()` will delete them
|
|
68
|
+
*/
|
|
69
|
+
export declare function markFilesToBeRemovedIfNeeded(succeededComponents: ComponentStatus[], componentsResults: ApplyVersionWithComps[]): void;
|
|
70
|
+
/**
|
|
71
|
+
* it's needed in case the checked out version removed files that exist on the current version.
|
|
72
|
+
* without this function, these files would be left on the filesystem.
|
|
73
|
+
*/
|
|
74
|
+
export declare function deleteFilesIfNeeded(componentsResults: ApplyVersionWithComps[], consumer: Consumer): Promise<void>;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
require("core-js/modules/es.array.flat.js");
|
|
5
|
+
require("core-js/modules/es.array.unscopables.flat.js");
|
|
6
|
+
require("core-js/modules/es.promise.js");
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.applyModifiedVersion = applyModifiedVersion;
|
|
11
|
+
exports.applyVersion = applyVersion;
|
|
12
|
+
exports.deleteFilesIfNeeded = deleteFilesIfNeeded;
|
|
13
|
+
exports.markFilesToBeRemovedIfNeeded = markFilesToBeRemovedIfNeeded;
|
|
14
|
+
function _defineProperty2() {
|
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
_defineProperty2 = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _lodash() {
|
|
22
|
+
const data = require("lodash");
|
|
23
|
+
_lodash = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function path() {
|
|
29
|
+
const data = _interopRequireWildcard(require("path"));
|
|
30
|
+
path = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _generalError() {
|
|
36
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
|
|
37
|
+
_generalError = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function _path2() {
|
|
43
|
+
const data = require("@teambit/legacy/dist/utils/path");
|
|
44
|
+
_path2 = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
function _dataToPersist() {
|
|
50
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/sources/data-to-persist"));
|
|
51
|
+
_dataToPersist = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
function _removePath() {
|
|
57
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/sources/remove-path"));
|
|
58
|
+
_removePath = function () {
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
function _mergeVersion() {
|
|
64
|
+
const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
|
|
65
|
+
_mergeVersion = function () {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
71
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
72
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
73
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
74
|
+
/**
|
|
75
|
+
* 1) when the files are modified with conflicts and the strategy is "ours", leave the FS as is
|
|
76
|
+
* and update only bitmap id version. (not the componentMap object).
|
|
77
|
+
*
|
|
78
|
+
* 2) when the files are modified with conflicts and the strategy is "theirs", write the component
|
|
79
|
+
* according to id.version.
|
|
80
|
+
*
|
|
81
|
+
* 3) when files are modified with no conflict or files are modified with conflicts and the
|
|
82
|
+
* strategy is manual, load the component according to id.version and update component.files.
|
|
83
|
+
* applyModifiedVersion() docs explains what files are updated/added.
|
|
84
|
+
*
|
|
85
|
+
* 4) when --reset flag is used, write the component according to the bitmap version
|
|
86
|
+
*
|
|
87
|
+
* Side note:
|
|
88
|
+
* Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).
|
|
89
|
+
* Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles
|
|
90
|
+
*/
|
|
91
|
+
async function applyVersion(consumer, id, componentFromFS,
|
|
92
|
+
// it can be null only when isLanes is true
|
|
93
|
+
mergeResults, checkoutProps) {
|
|
94
|
+
if (!checkoutProps.isLane && !componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);
|
|
95
|
+
const {
|
|
96
|
+
mergeStrategy
|
|
97
|
+
} = checkoutProps;
|
|
98
|
+
let filesStatus = {};
|
|
99
|
+
if (mergeResults && mergeResults.hasConflicts && mergeStrategy === _mergeVersion().MergeOptions.ours) {
|
|
100
|
+
// even when isLane is true, the mergeResults is possible only when the component is on the filesystem
|
|
101
|
+
// otherwise it's impossible to have conflicts
|
|
102
|
+
if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);
|
|
103
|
+
componentFromFS.files.forEach(file => {
|
|
104
|
+
filesStatus[(0, _path2().pathNormalizeToLinux)(file.relative)] = _mergeVersion().FileStatus.unchanged;
|
|
105
|
+
});
|
|
106
|
+
consumer.bitMap.updateComponentId(id);
|
|
107
|
+
return {
|
|
108
|
+
applyVersionResult: {
|
|
109
|
+
id,
|
|
110
|
+
filesStatus
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const component = await consumer.loadComponentFromModelImportIfNeeded(id);
|
|
115
|
+
const componentMap = componentFromFS && componentFromFS.componentMap;
|
|
116
|
+
if (componentFromFS && !componentMap) throw new (_generalError().default)('applyVersion: componentMap was not found');
|
|
117
|
+
const files = component.files;
|
|
118
|
+
files.forEach(file => {
|
|
119
|
+
filesStatus[(0, _path2().pathNormalizeToLinux)(file.relative)] = _mergeVersion().FileStatus.updated;
|
|
120
|
+
});
|
|
121
|
+
if (mergeResults) {
|
|
122
|
+
// update files according to the merge results
|
|
123
|
+
const {
|
|
124
|
+
filesStatus: modifiedStatus,
|
|
125
|
+
modifiedFiles
|
|
126
|
+
} = applyModifiedVersion(files, mergeResults, mergeStrategy);
|
|
127
|
+
filesStatus = _objectSpread(_objectSpread({}, filesStatus), modifiedStatus);
|
|
128
|
+
component.files = modifiedFiles;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
applyVersionResult: {
|
|
132
|
+
id,
|
|
133
|
+
filesStatus
|
|
134
|
+
},
|
|
135
|
+
component
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* relevant only when
|
|
141
|
+
* 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.
|
|
142
|
+
* 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.
|
|
143
|
+
*
|
|
144
|
+
* this function only updates the files content, it doesn't write the files
|
|
145
|
+
*/
|
|
146
|
+
function applyModifiedVersion(componentFiles, mergeResults, mergeStrategy) {
|
|
147
|
+
let modifiedFiles = componentFiles.map(file => file.clone());
|
|
148
|
+
const filesStatus = {};
|
|
149
|
+
if (mergeResults.hasConflicts && mergeStrategy !== _mergeVersion().MergeOptions.manual) {
|
|
150
|
+
return {
|
|
151
|
+
filesStatus,
|
|
152
|
+
modifiedFiles
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
mergeResults.modifiedFiles.forEach(file => {
|
|
156
|
+
const filePath = path().normalize(file.filePath);
|
|
157
|
+
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
158
|
+
if (!foundFile) throw new (_generalError().default)(`file ${filePath} not found`);
|
|
159
|
+
if (file.conflict) {
|
|
160
|
+
foundFile.contents = Buffer.from(file.conflict);
|
|
161
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.manual;
|
|
162
|
+
} else if (typeof file.output === 'string') {
|
|
163
|
+
foundFile.contents = Buffer.from(file.output);
|
|
164
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.merged;
|
|
165
|
+
} else if (file.isBinaryConflict) {
|
|
166
|
+
// leave the file as is and notify the user later about it.
|
|
167
|
+
foundFile.contents = file.fsFile.contents;
|
|
168
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.binaryConflict;
|
|
169
|
+
} else {
|
|
170
|
+
throw new (_generalError().default)(`file ${filePath} does not have output nor conflict`);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
mergeResults.addFiles.forEach(file => {
|
|
174
|
+
const filePath = path().normalize(file.filePath);
|
|
175
|
+
if (modifiedFiles.find(m => m.relative === filePath)) return;
|
|
176
|
+
modifiedFiles.push(file.fsFile);
|
|
177
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.added;
|
|
178
|
+
});
|
|
179
|
+
mergeResults.deletedConflictFiles.forEach(file => {
|
|
180
|
+
if (!file.fsFile) return;
|
|
181
|
+
const filePath = path().normalize(file.filePath);
|
|
182
|
+
if (modifiedFiles.find(m => m.relative === filePath)) return;
|
|
183
|
+
modifiedFiles.push(file.fsFile);
|
|
184
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.added;
|
|
185
|
+
});
|
|
186
|
+
mergeResults.removeFiles.forEach(file => {
|
|
187
|
+
const filePath = path().normalize(file.filePath);
|
|
188
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.removed;
|
|
189
|
+
modifiedFiles = modifiedFiles.filter(f => f.relative !== filePath);
|
|
190
|
+
});
|
|
191
|
+
mergeResults.remainDeletedFiles.forEach(file => {
|
|
192
|
+
const filePath = path().normalize(file.filePath);
|
|
193
|
+
modifiedFiles = modifiedFiles.filter(f => f.relative !== filePath);
|
|
194
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.remainDeleted;
|
|
195
|
+
});
|
|
196
|
+
mergeResults.deletedConflictFiles.forEach(file => {
|
|
197
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.deletedConflict;
|
|
198
|
+
});
|
|
199
|
+
mergeResults.overrideFiles.forEach(file => {
|
|
200
|
+
const filePath = path().normalize(file.filePath);
|
|
201
|
+
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
202
|
+
if (!foundFile) throw new (_generalError().default)(`file ${filePath} not found`);
|
|
203
|
+
foundFile.contents = file.fsFile.contents;
|
|
204
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.overridden;
|
|
205
|
+
});
|
|
206
|
+
mergeResults.updatedFiles.forEach(file => {
|
|
207
|
+
const filePath = path().normalize(file.filePath);
|
|
208
|
+
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
209
|
+
if (!foundFile) throw new (_generalError().default)(`file ${filePath} not found`);
|
|
210
|
+
foundFile.contents = file.content;
|
|
211
|
+
filesStatus[file.filePath] = _mergeVersion().FileStatus.updated;
|
|
212
|
+
});
|
|
213
|
+
return {
|
|
214
|
+
filesStatus,
|
|
215
|
+
modifiedFiles
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* when files exist on the filesystem but not on the checked out versions, they need to be deleted.
|
|
221
|
+
* this function only mark them as such. later `deleteFilesIfNeeded()` will delete them
|
|
222
|
+
*/
|
|
223
|
+
function markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults) {
|
|
224
|
+
const succeededComponentsByBitId = succeededComponents.reduce((accum, next) => {
|
|
225
|
+
const bitId = next.id.toString();
|
|
226
|
+
if (!accum[bitId]) accum[bitId] = next;
|
|
227
|
+
return accum;
|
|
228
|
+
}, {});
|
|
229
|
+
componentsResults.forEach(componentResult => {
|
|
230
|
+
var _succeededComponent$c;
|
|
231
|
+
const existingFilePathsFromModel = componentResult.applyVersionResult.filesStatus;
|
|
232
|
+
const bitId = componentResult.applyVersionResult.id.toString();
|
|
233
|
+
const succeededComponent = succeededComponentsByBitId[bitId];
|
|
234
|
+
const filePathsFromFS = ((_succeededComponent$c = succeededComponent.componentFromFS) === null || _succeededComponent$c === void 0 ? void 0 : _succeededComponent$c.files) || [];
|
|
235
|
+
filePathsFromFS.forEach(file => {
|
|
236
|
+
const filename = (0, _path2().pathNormalizeToLinux)(file.relative);
|
|
237
|
+
if (!existingFilePathsFromModel[filename]) {
|
|
238
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
239
|
+
existingFilePathsFromModel[filename] = _mergeVersion().FileStatus.removed;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* it's needed in case the checked out version removed files that exist on the current version.
|
|
247
|
+
* without this function, these files would be left on the filesystem.
|
|
248
|
+
*/
|
|
249
|
+
async function deleteFilesIfNeeded(componentsResults, consumer) {
|
|
250
|
+
const pathsToRemoveIncludeNull = componentsResults.map(compResult => {
|
|
251
|
+
return Object.keys(compResult.applyVersionResult.filesStatus).map(filePath => {
|
|
252
|
+
if (compResult.applyVersionResult.filesStatus[filePath] === _mergeVersion().FileStatus.removed) {
|
|
253
|
+
var _compResult$component, _compResult$component2;
|
|
254
|
+
if (!((_compResult$component = compResult.component) !== null && _compResult$component !== void 0 && _compResult$component.writtenPath)) return null;
|
|
255
|
+
return path().join((_compResult$component2 = compResult.component) === null || _compResult$component2 === void 0 ? void 0 : _compResult$component2.writtenPath, filePath);
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
const pathsToRemove = (0, _lodash().compact)(pathsToRemoveIncludeNull.flat());
|
|
261
|
+
const dataToPersist = new (_dataToPersist().default)();
|
|
262
|
+
dataToPersist.removeManyPaths(pathsToRemove.map(p => new (_removePath().default)(p, true)));
|
|
263
|
+
dataToPersist.addBasePath(consumer.getPath());
|
|
264
|
+
await dataToPersist.persistAllToFS();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
//# sourceMappingURL=checkout-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","filesStatus","hasConflicts","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","GeneralError","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","componentFiles","map","clone","manual","filePath","path","normalize","foundFile","find","componentFile","conflict","contents","Buffer","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","push","added","deletedConflictFiles","removeFiles","removed","filter","f","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","markFilesToBeRemovedIfNeeded","succeededComponents","componentsResults","succeededComponentsByBitId","reduce","accum","next","bitId","componentResult","existingFilePathsFromModel","succeededComponent","filePathsFromFS","filename","deleteFilesIfNeeded","pathsToRemoveIncludeNull","compResult","Object","keys","writtenPath","join","pathsToRemove","compact","flat","dataToPersist","DataToPersist","removeManyPaths","p","RemovePath","addBasePath","getPath","persistAllToFS"],"sources":["checkout-version.ts"],"sourcesContent":["import { compact } from 'lodash';\nimport * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport Version from '@teambit/legacy/dist/scope/models/version';\nimport { SourceFile } from '@teambit/legacy/dist/consumer/component/sources';\nimport { pathNormalizeToLinux, PathOsBased } from '@teambit/legacy/dist/utils/path';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport {\n ApplyVersionResult,\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: BitId[];\n latestVersion?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n ignorePackageJson?: boolean;\n writeConfig?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n ignoreDist?: boolean;\n isLane?: boolean;\n};\nexport type ComponentStatus = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\ntype ApplyVersionWithComps = { applyVersionResult: ApplyVersionResult; component?: ConsumerComponent };\n\n/**\n * 1) when the files are modified with conflicts and the strategy is \"ours\", leave the FS as is\n * and update only bitmap id version. (not the componentMap object).\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", write the component\n * according to id.version.\n *\n * 3) when files are modified with no conflict or files are modified with conflicts and the\n * strategy is manual, load the component according to id.version and update component.files.\n * applyModifiedVersion() docs explains what files are updated/added.\n *\n * 4) when --reset flag is used, write the component according to the bitmap version\n *\n * Side note:\n * Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).\n * Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles\n */\nexport async function applyVersion(\n consumer: Consumer,\n id: BitId,\n componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true\n mergeResults: MergeResultsThreeWay | null | undefined,\n checkoutProps: CheckoutProps\n): Promise<ApplyVersionWithComps> {\n if (!checkoutProps.isLane && !componentFromFS)\n throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n const { mergeStrategy } = checkoutProps;\n let filesStatus = {};\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n // even when isLane is true, the mergeResults is possible only when the component is on the filesystem\n // otherwise it's impossible to have conflicts\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n consumer.bitMap.updateComponentId(id);\n return { applyVersionResult: { id, filesStatus } };\n }\n const component = await consumer.loadComponentFromModelImportIfNeeded(id);\n const componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n\n const files = component.files;\n files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n filesStatus = { ...filesStatus, ...modifiedStatus };\n component.files = modifiedFiles;\n }\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new GeneralError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new GeneralError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * this function only mark them as such. later `deleteFilesIfNeeded()` will delete them\n */\nexport function markFilesToBeRemovedIfNeeded(\n succeededComponents: ComponentStatus[],\n componentsResults: ApplyVersionWithComps[]\n) {\n const succeededComponentsByBitId: { [K in string]: ComponentStatus } = succeededComponents.reduce((accum, next) => {\n const bitId = next.id.toString();\n if (!accum[bitId]) accum[bitId] = next;\n return accum;\n }, {});\n\n componentsResults.forEach((componentResult) => {\n const existingFilePathsFromModel = componentResult.applyVersionResult.filesStatus;\n const bitId = componentResult.applyVersionResult.id.toString();\n const succeededComponent = succeededComponentsByBitId[bitId];\n const filePathsFromFS = succeededComponent.componentFromFS?.files || [];\n\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!existingFilePathsFromModel[filename]) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n existingFilePathsFromModel[filename] = FileStatus.removed;\n }\n });\n });\n}\n\n/**\n * it's needed in case the checked out version removed files that exist on the current version.\n * without this function, these files would be left on the filesystem.\n */\nexport async function deleteFilesIfNeeded(\n componentsResults: ApplyVersionWithComps[],\n consumer: Consumer\n): Promise<void> {\n const pathsToRemoveIncludeNull = componentsResults.map((compResult) => {\n return Object.keys(compResult.applyVersionResult.filesStatus).map((filePath) => {\n if (compResult.applyVersionResult.filesStatus[filePath] === FileStatus.removed) {\n if (!compResult.component?.writtenPath) return null;\n return path.join(compResult.component?.writtenPath, filePath);\n }\n return null;\n });\n });\n const pathsToRemove = compact(pathsToRemoveIncludeNull.flat());\n const dataToPersist = new DataToPersist();\n dataToPersist.removeManyPaths(pathsToRemove.map((p) => new RemovePath(p, true)));\n dataToPersist.addBasePath(consum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D,UAAU,IAAK;IACrE,OAAOC,MAAM,CAACC,IAAI,CAACF,UAAU,CAAC3D,kBAAkB,CAACb,WAAW,CAAC,CAACuB,GAAG,CAAEG,QAAQ,IAAK;MAC9E,IAAI8C,UAAU,CAAC3D,kBAAkB,CAACb,WAAW,CAAC0B,QAAQ,CAAC,KAAKjB,0BAAU,CAACsC,OAAO,EAAE;QAAA;QAC9E,IAAI,2BAACyB,UAAU,CAAC1D,SAAS,kDAApB,sBAAsB6D,WAAW,GAAE,OAAO,IAAI;QACnD,OAAOhD,IAAI,GAACiD,IAAI,2BAACJ,UAAU,CAAC1D,SAAS,2DAApB,uBAAsB6D,WAAW,EAAEjD,QAAQ,CAAC;MAC/D;MACA,OAAO,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,CAAC;EACF,MAAMmD,aAAa,GAAG,IAAAC,iBAAO,EAACP,wBAAwB,CAACQ,IAAI,EAAE,CAAC;EAC9D,MAAMC,aAAa,GAAG,KAAIC,wBAAa,GAAE;EACzCD,aAAa,CAACE,eAAe,CAACL,aAAa,CAACtD,GAAG,CAAE4D,CAAC,IAAK,KAAIC,qBAAU,EAACD,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;EAChFH,aAAa,CAACK,WAAW,CAAC9F,QAAQ,CAAC+F,OAAO,EAAE,CAAC;EAC7C,MAAMN,aAAa,CAACO,cAAc,EAAE;AACtC"}
|
|
@@ -86,13 +86,6 @@ function _componentWriter() {
|
|
|
86
86
|
};
|
|
87
87
|
return data;
|
|
88
88
|
}
|
|
89
|
-
function _checkoutVersion() {
|
|
90
|
-
const data = require("@teambit/legacy/dist/consumer/versions-ops/checkout-version");
|
|
91
|
-
_checkoutVersion = function () {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
return data;
|
|
95
|
-
}
|
|
96
89
|
function _mergeVersion() {
|
|
97
90
|
const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
|
|
98
91
|
_mergeVersion = function () {
|
|
@@ -142,6 +135,13 @@ function _checkout() {
|
|
|
142
135
|
};
|
|
143
136
|
return data;
|
|
144
137
|
}
|
|
138
|
+
function _checkoutVersion() {
|
|
139
|
+
const data = require("./checkout-version");
|
|
140
|
+
_checkoutVersion = function () {
|
|
141
|
+
return data;
|
|
142
|
+
};
|
|
143
|
+
return data;
|
|
144
|
+
}
|
|
145
145
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
146
146
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
147
147
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -387,6 +387,13 @@ class CheckoutMain {
|
|
|
387
387
|
if (headVersion && currentlyUsedVersion === newVersion) {
|
|
388
388
|
return returnFailure(`component ${component.id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`, true);
|
|
389
389
|
}
|
|
390
|
+
if (!reset) {
|
|
391
|
+
const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);
|
|
392
|
+
const isMergePending = divergeDataForMergePending.isDiverged();
|
|
393
|
+
if (isMergePending) {
|
|
394
|
+
return returnFailure(`component is merge-pending and cannot be checked out, run "bit status" for more info`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
390
397
|
const currentVersionObject = await componentModel.loadVersion(currentlyUsedVersion, repo);
|
|
391
398
|
const isModified = await consumer.isComponentModified(currentVersionObject, component);
|
|
392
399
|
if (!isModified && reset) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckoutMain","constructor","workspace","logger","componentWriter","importer","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","importCurrentObjects","bitIds","BitIds","fromArray","map","id","_legacy","components","loadComponents","allComponentStatusBeforeMerge","Promise","all","component","getComponentStatusBeforeMergeAttempt","compsNeedMerge","filter","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","push","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importManyIfMissingWithoutDeps","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","mergeResults","hasConflicts","mergeStrategy","GeneralError","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","length","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","n","toString","installationError","compilationError","checkoutByCLIValues","to","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","hasScope","changeScope","scopeComponentsImporter","importManyDeltaWithoutDeps","fromHead","error","unavailableOnMain","getUnavailableOnMainComponents","bitMap","makeComponentsAvailableOnMain","HEAD","LATEST","latest","BitId","isValidVersion","BitError","console","idsOnWorkspace","idsByPattern","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","lane","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","latestVersion","repo","objects","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","name","getNewVersion","headIncludeRemote","newVersion","hasVersion","existingBitMapId","getBitId","ignoreVersion","currentVersionObject","loadVersion","isModified","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport {\n applyVersion,\n markFilesToBeRemovedIfNeeded,\n ComponentStatus,\n deleteFilesIfNeeded,\n} from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n MergeStrategy,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport mapSeries from 'p-map-series';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Version, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n isLane?: boolean;\n workspaceOnly?: boolean;\n};\n\nexport type ComponentStatusBeforeMergeAttempt = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\ntype CheckoutTo = 'head' | 'reset' | string;\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n const bitIds = BitIds.fromArray(ids?.map((id) => id._legacy) || []);\n const { components } = await consumer.loadComponents(bitIds);\n\n const allComponentStatusBeforeMerge = await Promise.all(\n components.map((component) => this.getComponentStatusBeforeMergeAttempt(component, checkoutProps))\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n await this.workspace.scope.legacyScope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\n await tmp.clear();\n return afterMergeAttempt;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n\n const compStatusMergeNeeded = await getComponentsStatusOfMergeNeeded();\n\n const allComponentsStatus: ComponentStatus[] = [...compStatusMergeNeeded, ...compsNotNeedMerge];\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!promptMergeOptions && !checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id._legacy) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(consumer, id, componentFromFS, mergeResults, checkoutPropsLegacy);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id._legacy))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, consumer);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n return {\n components: appliedVersionComponents,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async checkoutByCLIValues(\n to: CheckoutTo,\n componentPattern: string,\n checkoutProps: CheckoutProps\n ): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n if (to === 'head') await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(to, componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy();\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !id._legacy.hasScope()).map((id) => id._legacy.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: BitIds.fromArray(notExported || []),\n fromHead: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(to: CheckoutTo, componentPattern: string, checkoutProps: CheckoutProps) {\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else {\n if (!BitId.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new GeneralError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new GeneralError('please specify [component-pattern] or use --all flag');\n }\n if (checkoutProps.workspaceOnly && !checkoutProps.head) {\n throw new BitError(`--workspace-only flag can only be used with \"head\" (bit checkout head --workspace-only)`);\n }\n const idsOnWorkspace = componentPattern\n ? await this.workspace.idsByPattern(componentPattern)\n : await this.workspace.listIds();\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id._legacy))\n : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id._legacy.isEqualWithoutVersion(bitId)));\n const newComponentIds = await this.workspace.resolveMultipleComponentIds(newIds);\n const nonRemovedNewIds: ComponentID[] = [];\n await Promise.all(\n newComponentIds.map(async (id) => {\n const isRemoved = await this.workspace.scope.isComponentRemoved(id);\n if (!isRemoved) nonRemovedNewIds.push(id);\n })\n );\n return nonRemovedNewIds;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n component: ConsumerComponent,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const { version, head: headVersion, reset, latest: latestVersion } = checkoutProps;\n const repo = consumer.scope.objects;\n const componentModel = await consumer.scope.getModelComponentIfExist(component.id);\n const componentStatus: ComponentStatus = { id: component.id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${component.id.toString()} is new, no version to checkout`, true);\n }\n const unmerged = repo.unmergedComponents.getEntry(component.name);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const getNewVersion = async (): Promise<string> => {\n if (reset) return component.id.version as string;\n\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (latestVersion) return componentModel.latestVersion();\n // @ts-ignore if !reset the version is defined\n return version;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion)\n return returnFailure(`component ${component.id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const existingBitMapId = consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const currentlyUsedVersion = existingBitMapId.version;\n if (!currentlyUsedVersion) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n const isModified = await consumer.isComponentModified(currentVersionObject, component);\n if (!isModified && reset) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is not modified`, true);\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version;\n const newId = component.id.changeVersion(newVersion);\n\n if (reset || !isModified) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n componentFromFS,\n componentFromModel,\n id,\n propsForMerge,\n }: ComponentStatusBeforeMergeAttempt): Promise<ComponentStatus> {\n if (!propsForMerge) throw new Error(`propsForMerge is missing for ${id.toString()}`);\n if (!componentFromFS) throw new Error(`componentFromFS is missing for ${id.toString()}`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const { currentlyUsedVersion, componentModel } = propsForMerge;\n\n // this is tricky. imagine the user is 0.0.2+modification and wants to checkout to 0.0.1.\n // the base is 0.0.1, as it's the common version for 0.0.1 and 0.0.2. however, if we let git merge-file use the 0.0.1\n // as the base, then, it'll get the changes done since 0.0.1 to 0.0.1, which is nothing, and put them on top of\n // 0.0.2+modification. in other words, it won't make any change.\n // this scenario of checking out while there are modified files, is forbidden in Git. here, we want to simulate a similar\n // experience of \"git stash\", then \"git checkout\", then \"git stash pop\". practically, we want the changes done on 0.0.2\n // to be added to 0.0.1\n // if there is no modification, it doesn't go the threeWayMerge anyway, so it doesn't matter what the base is.\n const baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n const baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer);\n cli.register(new Checko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C;IAAa,CAAC;EAClE;EAOA,aAAa+H,QAAQ,CAAC,CAACC,GAAG,EAAEpL,SAAS,EAAEqL,UAAU,EAAEC,UAAU,EAAEnL,QAAQ,CAMtE,EAAE;IACD,MAAMF,MAAM,GAAGoL,UAAU,CAACE,YAAY,CAACC,0BAAc,CAACxK,EAAE,CAAC;IACzD,MAAMyK,YAAY,GAAG,IAAI3L,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAEqL,UAAU,EAAEnL,QAAQ,CAAC;IAC9EiL,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,CAAC;IAC3C,OAAOA,YAAY;EACrB;AACF;AAAC;AAAA,gCA3VY3L,YAAY,WA0UR,EAAE;AAAA,gCA1UNA,YAAY,kBA2UD,CAAC8L,gBAAS,EAAEC,oBAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,mBAAc,CAAC;AAAA,gCA3U5FlM,YAAY,aA6UNmM,kBAAW;AAgB9BT,0BAAc,CAACU,UAAU,CAACpM,YAAY,CAAC;AAAC,eAEzBA,YAAY;AAAA"}
|
|
1
|
+
{"version":3,"names":["CheckoutMain","constructor","workspace","logger","componentWriter","importer","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","importCurrentObjects","bitIds","BitIds","fromArray","map","id","_legacy","components","loadComponents","allComponentStatusBeforeMerge","Promise","all","component","getComponentStatusBeforeMergeAttempt","compsNeedMerge","filter","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","push","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importManyIfMissingWithoutDeps","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","mergeResults","hasConflicts","mergeStrategy","GeneralError","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","length","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","n","toString","installationError","compilationError","checkoutByCLIValues","to","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","hasScope","changeScope","scopeComponentsImporter","importManyDeltaWithoutDeps","fromHead","error","unavailableOnMain","getUnavailableOnMainComponents","bitMap","makeComponentsAvailableOnMain","HEAD","LATEST","latest","BitId","isValidVersion","BitError","console","idsOnWorkspace","idsByPattern","listIds","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","lane","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","latestVersion","repo","objects","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","name","getNewVersion","headIncludeRemote","newVersion","hasVersion","existingBitMapId","getBitId","ignoreVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","currentVersionObject","loadVersion","isModified","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n MergeStrategy,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport mapSeries from 'p-map-series';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Version, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, markFilesToBeRemovedIfNeeded, ComponentStatus, deleteFilesIfNeeded } from './checkout-version';\n\nexport type CheckoutProps = {\n version?: string; // if reset is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n all?: boolean; // checkout all ids\n isLane?: boolean;\n workspaceOnly?: boolean;\n};\n\nexport type ComponentStatusBeforeMergeAttempt = {\n componentFromFS?: ConsumerComponent;\n componentFromModel?: Version;\n id: BitId;\n failureMessage?: string;\n unchangedLegitimately?: boolean; // failed to checkout but for a legitimate reason, such as, up-to-date\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\ntype CheckoutTo = 'head' | 'reset' | string;\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n const bitIds = BitIds.fromArray(ids?.map((id) => id._legacy) || []);\n const { components } = await consumer.loadComponents(bitIds);\n\n const allComponentStatusBeforeMerge = await Promise.all(\n components.map((component) => this.getComponentStatusBeforeMergeAttempt(component, checkoutProps))\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n await this.workspace.scope.legacyScope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\n await tmp.clear();\n return afterMergeAttempt;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n\n const compStatusMergeNeeded = await getComponentsStatusOfMergeNeeded();\n\n const allComponentsStatus: ComponentStatus[] = [...compStatusMergeNeeded, ...compsNotNeedMerge];\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!promptMergeOptions && !checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id._legacy) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(consumer, id, componentFromFS, mergeResults, checkoutPropsLegacy);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id._legacy))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, consumer);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n return {\n components: appliedVersionComponents,\n version,\n failedComponents,\n leftUnresolvedConflicts,\n newFromLane: newFromLane?.map((n) => n.toString()),\n newFromLaneAdded,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async checkoutByCLIValues(\n to: CheckoutTo,\n componentPattern: string,\n checkoutProps: CheckoutProps\n ): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n if (to === 'head') await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(to, componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy();\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !id._legacy.hasScope()).map((id) => id._legacy.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: BitIds.fromArray(notExported || []),\n fromHead: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(to: CheckoutTo, componentPattern: string, checkoutProps: CheckoutProps) {\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else {\n if (!BitId.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new GeneralError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new GeneralError('please specify [component-pattern] or use --all flag');\n }\n if (checkoutProps.workspaceOnly && !checkoutProps.head) {\n throw new BitError(`--workspace-only flag can only be used with \"head\" (bit checkout head --workspace-only)`);\n }\n const idsOnWorkspace = componentPattern\n ? await this.workspace.idsByPattern(componentPattern)\n : await this.workspace.listIds();\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds\n ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id._legacy))\n : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id._legacy.isEqualWithoutVersion(bitId)));\n const newComponentIds = await this.workspace.resolveMultipleComponentIds(newIds);\n const nonRemovedNewIds: ComponentID[] = [];\n await Promise.all(\n newComponentIds.map(async (id) => {\n const isRemoved = await this.workspace.scope.isComponentRemoved(id);\n if (!isRemoved) nonRemovedNewIds.push(id);\n })\n );\n return nonRemovedNewIds;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n component: ConsumerComponent,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const { version, head: headVersion, reset, latest: latestVersion } = checkoutProps;\n const repo = consumer.scope.objects;\n const componentModel = await consumer.scope.getModelComponentIfExist(component.id);\n const componentStatus: ComponentStatus = { id: component.id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${component.id.toString()} is new, no version to checkout`, true);\n }\n const unmerged = repo.unmergedComponents.getEntry(component.name);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const getNewVersion = async (): Promise<string> => {\n if (reset) return component.id.version as string;\n\n if (headVersion) return componentModel.headIncludeRemote(repo);\n if (latestVersion) return componentModel.latestVersion();\n // @ts-ignore if !reset the version is defined\n return version;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion)\n return returnFailure(`component ${component.id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const existingBitMapId = consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const currentlyUsedVersion = existingBitMapId.version;\n if (!currentlyUsedVersion) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${component.id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n if (!reset) {\n const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);\n const isMergePending = divergeDataForMergePending.isDiverged();\n if (isMergePending) {\n return returnFailure(`component is merge-pending and cannot be checked out, run \"bit status\" for more info`);\n }\n }\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n const isModified = await consumer.isComponentModified(currentVersionObject, component);\n if (!isModified && reset) {\n return returnFailure(`component ${component.id.toStringWithoutVersion()} is not modified`, true);\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version;\n const newId = component.id.changeVersion(newVersion);\n\n if (reset || !isModified) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { componentFromFS: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n componentFromFS,\n componentFromModel,\n id,\n propsForMerge,\n }: ComponentStatusBeforeMergeAttempt): Promise<ComponentStatus> {\n if (!propsForMerge) throw new Error(`propsForMerge is missing for ${id.toString()}`);\n if (!componentFromFS) throw new Error(`componentFromFS is missing for ${id.toString()}`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const { currentlyUsedVersion, componentModel } = propsForMerge;\n\n // this is tricky. imagine the user is 0.0.2+modification and wants to checkout to 0.0.1.\n // the base is 0.0.1, as it's the common version for 0.0.1 and 0.0.2. however, if we let git merge-file use the 0.0.1\n // as the base, then, it'll get the changes done since 0.0.1 to 0.0.1, which is nothing, and put them on top of\n // 0.0.2+modification. in other words, it won't make any change.\n // this scenario of checking out while there are modified files, is forbidden in Git. here, we want to simulate a similar\n // experience of \"git stash\", then \"git checkout\", then \"git stash pop\". practically, we want the changes done on 0.0.2\n // to be added to 0.0.1\n // if there is no modification, it doesn't go the threeWayMerge anyway, so it doesn't matter what the base is.\n const baseVersion = currentlyUsedVersion;\n const newVersion = id.version as string;\n const baseComponent: Version = await componentModel.loadVersion(baseVersion, repo);\n const otherComponent: Version = await componentModel.loadVersion(newVersion, repo);\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: newVersion,\n currentComponent: componentFromFS,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n\n return { componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer);\n cli.register(new CheckoutCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;E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M,gBAAS,EAAEC,oBAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,mBAAc,CAAC;AAAA,gCAlV5FtM,YAAY,aAoVNuM,kBAAW;AAgB9BT,0BAAc,CAACU,UAAU,CAACxM,YAAY,CAAC;AAAC,eAEzBA,YAAY;AAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { CheckoutAspect } from './checkout.aspect';
|
|
|
2
2
|
export type { CheckoutMain } from './checkout.main.runtime';
|
|
3
3
|
export default CheckoutAspect;
|
|
4
4
|
export { CheckoutAspect };
|
|
5
|
+
export { CheckoutProps, ComponentStatus, applyModifiedVersion, applyVersion, deleteFilesIfNeeded, markFilesToBeRemovedIfNeeded, } from './checkout-version';
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,43 @@ Object.defineProperty(exports, "CheckoutAspect", {
|
|
|
9
9
|
return _checkout().CheckoutAspect;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "CheckoutProps", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _checkoutVersion().CheckoutProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ComponentStatus", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _checkoutVersion().ComponentStatus;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "applyModifiedVersion", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _checkoutVersion().applyModifiedVersion;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "applyVersion", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _checkoutVersion().applyVersion;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
12
36
|
exports.default = void 0;
|
|
37
|
+
Object.defineProperty(exports, "deleteFilesIfNeeded", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _checkoutVersion().deleteFilesIfNeeded;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "markFilesToBeRemovedIfNeeded", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _checkoutVersion().markFilesToBeRemovedIfNeeded;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
13
49
|
function _checkout() {
|
|
14
50
|
const data = require("./checkout.aspect");
|
|
15
51
|
_checkout = function () {
|
|
@@ -17,6 +53,13 @@ function _checkout() {
|
|
|
17
53
|
};
|
|
18
54
|
return data;
|
|
19
55
|
}
|
|
56
|
+
function _checkoutVersion() {
|
|
57
|
+
const data = require("./checkout-version");
|
|
58
|
+
_checkoutVersion = function () {
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
20
63
|
var _default = _checkout().CheckoutAspect;
|
|
21
64
|
exports.default = _default;
|
|
22
65
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckoutAspect"],"sources":["index.ts"],"sourcesContent":["import { CheckoutAspect } from './checkout.aspect';\n\nexport type { CheckoutMain } from './checkout.main.runtime';\nexport default CheckoutAspect;\nexport { CheckoutAspect };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CheckoutAspect"],"sources":["index.ts"],"sourcesContent":["import { CheckoutAspect } from './checkout.aspect';\n\nexport type { CheckoutMain } from './checkout.main.runtime';\nexport default CheckoutAspect;\nexport { CheckoutAspect };\n\nexport {\n CheckoutProps,\n ComponentStatus,\n applyModifiedVersion,\n applyVersion,\n deleteFilesIfNeeded,\n markFilesToBeRemovedIfNeeded,\n} from './checkout-version';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAO4B,eAVbA,0BAAc;AAAA"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/checkout",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.224",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/checkout",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "checkout",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.224"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"p-map-series": "2.1.0",
|
|
15
15
|
"core-js": "^3.0.0",
|
|
16
16
|
"@babel/runtime": "7.20.0",
|
|
17
|
+
"@teambit/legacy-bit-id": "0.0.423",
|
|
17
18
|
"@teambit/harmony": "0.4.6",
|
|
18
19
|
"@teambit/component-id": "0.0.427",
|
|
19
|
-
"@teambit/
|
|
20
|
+
"@teambit/cli": "0.0.711",
|
|
21
|
+
"@teambit/merging": "0.0.370",
|
|
20
22
|
"@teambit/bit-error": "0.0.402",
|
|
21
|
-
"@teambit/
|
|
22
|
-
"@teambit/
|
|
23
|
-
"@teambit/
|
|
24
|
-
"@teambit/
|
|
25
|
-
"@teambit/logger": "0.0.802",
|
|
26
|
-
"@teambit/workspace": "0.0.1053"
|
|
23
|
+
"@teambit/component-writer": "0.0.91",
|
|
24
|
+
"@teambit/importer": "0.0.484",
|
|
25
|
+
"@teambit/logger": "0.0.804",
|
|
26
|
+
"@teambit/workspace": "0.0.1055"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/lodash": "4.14.165",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@teambit/legacy": "1.0.
|
|
38
|
+
"@teambit/legacy": "1.0.491",
|
|
39
39
|
"react": "^16.8.0 || ^17.0.0",
|
|
40
40
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
41
41
|
},
|
|
Binary file
|
|
File without changes
|