@teambit/checkout 1.0.137 → 1.0.139
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
CHANGED
|
@@ -17,11 +17,12 @@ export declare class CheckoutCmd implements Command {
|
|
|
17
17
|
options: CommandOptions;
|
|
18
18
|
loader: boolean;
|
|
19
19
|
constructor(checkout: CheckoutMain);
|
|
20
|
-
report([to, componentPattern]: [string, string], { interactiveMerge, forceOurs, forceTheirs, autoMergeResolve, all, workspaceOnly, verbose, skipDependencyInstallation, revert, }: {
|
|
20
|
+
report([to, componentPattern]: [string, string], { interactiveMerge, forceOurs, forceTheirs, autoMergeResolve, manual, all, workspaceOnly, verbose, skipDependencyInstallation, revert, }: {
|
|
21
21
|
interactiveMerge?: boolean;
|
|
22
22
|
forceOurs?: boolean;
|
|
23
23
|
forceTheirs?: boolean;
|
|
24
24
|
autoMergeResolve?: MergeStrategy;
|
|
25
|
+
manual?: boolean;
|
|
25
26
|
all?: boolean;
|
|
26
27
|
workspaceOnly?: boolean;
|
|
27
28
|
verbose?: boolean;
|
package/dist/checkout-cmd.js
CHANGED
|
@@ -12,6 +12,13 @@ function _chalk() {
|
|
|
12
12
|
};
|
|
13
13
|
return data;
|
|
14
14
|
}
|
|
15
|
+
function _lodash() {
|
|
16
|
+
const data = require("lodash");
|
|
17
|
+
_lodash = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
15
22
|
function _merging() {
|
|
16
23
|
const data = require("@teambit/merging");
|
|
17
24
|
_merging = function () {
|
|
@@ -65,7 +72,7 @@ class CheckoutCmd {
|
|
|
65
72
|
\`bit checkout reset [component-pattern]\` => remove local modifications from the specified ids (or all components when --all is used)
|
|
66
73
|
when on a lane, "checkout head" only checks out components on this lane. to update main components, run "bit lane merge main"`);
|
|
67
74
|
_defineProperty(this, "alias", 'U');
|
|
68
|
-
_defineProperty(this, "options", [['i', 'interactive-merge', 'when a component is modified and the merge process found conflicts, display options to resolve them'], ['', 'auto-merge-resolve <merge-strategy>', 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]'], ['a', 'all', 'all components'], ['e', 'workspace-only', "only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace"], ['v', 'verbose', 'showing verbose output for inspection'], ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'], ['', 'force-ours', 'regardless of conflicts, ignore theirs changes and keep our local files intact'], ['', 'force-theirs', 'regardless of conflicts, ignore our local changes and use theirs files']]);
|
|
75
|
+
_defineProperty(this, "options", [['i', 'interactive-merge', 'when a component is modified and the merge process found conflicts, display options to resolve them'], ['', 'auto-merge-resolve <merge-strategy>', 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]'], ['', 'manual', 'same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers'], ['a', 'all', 'all components'], ['e', 'workspace-only', "only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace"], ['v', 'verbose', 'showing verbose output for inspection'], ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'], ['', 'force-ours', 'regardless of conflicts, ignore theirs changes and keep our local files intact'], ['', 'force-theirs', 'regardless of conflicts, ignore our local changes and use theirs files']]);
|
|
69
76
|
_defineProperty(this, "loader", true);
|
|
70
77
|
}
|
|
71
78
|
async report([to, componentPattern], {
|
|
@@ -73,6 +80,7 @@ when on a lane, "checkout head" only checks out components on this lane. to upda
|
|
|
73
80
|
forceOurs,
|
|
74
81
|
forceTheirs,
|
|
75
82
|
autoMergeResolve,
|
|
83
|
+
manual,
|
|
76
84
|
all = false,
|
|
77
85
|
workspaceOnly = false,
|
|
78
86
|
verbose = false,
|
|
@@ -85,6 +93,7 @@ when on a lane, "checkout head" only checks out components on this lane. to upda
|
|
|
85
93
|
if (autoMergeResolve && autoMergeResolve !== 'ours' && autoMergeResolve !== 'theirs' && autoMergeResolve !== 'manual') {
|
|
86
94
|
throw new (_bitError().BitError)('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');
|
|
87
95
|
}
|
|
96
|
+
if (manual) autoMergeResolve = 'manual';
|
|
88
97
|
if (workspaceOnly && to !== _constants().HEAD) {
|
|
89
98
|
throw new (_bitError().BitError)('--workspace-only is only relevant when running "bit checkout head" on a lane');
|
|
90
99
|
}
|
|
@@ -146,11 +155,11 @@ function checkoutOutput(checkoutResults, checkoutProps, alternativeTitle) {
|
|
|
146
155
|
}
|
|
147
156
|
const title = 'checkout was not required for the following component(s)';
|
|
148
157
|
const body = notCheckedOutComponents.map(failedComponent => `${failedComponent.id.toString()} - ${failedComponent.unchangedMessage}`).join('\n');
|
|
149
|
-
return `${_chalk().default.underline(title)}\n${body}
|
|
158
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
150
159
|
};
|
|
151
160
|
const getConflictSummary = () => {
|
|
152
161
|
if (!components || !components.length || !leftUnresolvedConflicts) return '';
|
|
153
|
-
const title =
|
|
162
|
+
const title = `files with conflicts summary\n`;
|
|
154
163
|
const suggestion = `\n\nfix the conflicts above manually and then run "bit install".
|
|
155
164
|
once ready, snap/tag the components to persist the changes`;
|
|
156
165
|
const conflictSummary = (0, _merging().conflictSummaryReport)(components);
|
|
@@ -190,21 +199,20 @@ once ready, snap/tag the components to persist the changes`;
|
|
|
190
199
|
if (!newFromLane?.length) return '';
|
|
191
200
|
const title = newFromLaneAdded ? `successfully added the following components from the lane` : `the following components exist on the lane but were not added to the workspace. omit --workspace-only flag to add them`;
|
|
192
201
|
const body = newFromLane.join('\n');
|
|
193
|
-
return
|
|
202
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
194
203
|
};
|
|
195
204
|
const getSummary = () => {
|
|
196
205
|
const checkedOut = components?.length || 0;
|
|
197
206
|
const notCheckedOutLegitimately = notCheckedOutComponents.length;
|
|
198
|
-
const newLines = '\n\n';
|
|
199
207
|
const title = _chalk().default.bold.underline('Summary');
|
|
200
208
|
const checkedOutStr = `\nTotal Changed: ${_chalk().default.bold(checkedOut.toString())}`;
|
|
201
209
|
const unchangedLegitimatelyStr = `\nTotal Unchanged: ${_chalk().default.bold(notCheckedOutLegitimately.toString())}`;
|
|
202
210
|
const newOnLaneNum = newFromLane?.length || 0;
|
|
203
211
|
const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';
|
|
204
212
|
const newOnLaneStr = newOnLaneNum ? `\nNew on lane${newOnLaneAddedStr}: ${_chalk().default.bold(newOnLaneNum.toString())}` : '';
|
|
205
|
-
return
|
|
213
|
+
return title + checkedOutStr + unchangedLegitimatelyStr + newOnLaneStr;
|
|
206
214
|
};
|
|
207
|
-
return getNotCheckedOutOutput()
|
|
215
|
+
return (0, _lodash().compact)([getNotCheckedOutOutput(), getSuccessfulOutput(), (0, _merging().getRemovedOutput)(removedComponents), (0, _merging().getAddedOutput)(addedComponents), getNewOnLaneOutput(), getConflictSummary(), getSummary(), (0, _merging().installationErrorOutput)(installationError), (0, _merging().compilationErrorOutput)(compilationError)]).join('\n\n');
|
|
208
216
|
}
|
|
209
217
|
|
|
210
218
|
//# sourceMappingURL=checkout-cmd.js.map
|
package/dist/checkout-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_merging","_constants","_componentId","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","forceOurs","forceTheirs","autoMergeResolve","all","workspaceOnly","verbose","skipDependencyInstallation","revert","BitError","HEAD","checkoutProps","promptMergeOptions","mergeStrategy","isLane","skipNpmInstall","head","LATEST","latest","reset","main","ComponentID","isValidVersion","version","checkoutResults","checkoutByCLIValues","checkoutOutput","exports","alternativeTitle","components","failedComponents","removedComponents","addedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","realFailedComponents","filter","f","unchangedLegitimately","length","Error","notCheckedOutComponents","getNotCheckedOutOutput","chalk","green","bold","toString","title","body","map","failedComponent","id","unchangedMessage","join","underline","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictStr","yellow","getSuccessfulOutput","newLine","switchedOrReverted","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","newLines","checkedOutStr","unchangedLegitimatelyStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","getRemovedOutput","getAddedOutput","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'reference/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n\\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n\\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag (use --latest if you only want semver tags), omit [component-pattern] to checkout head for all\n\\`bit checkout 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)\nwhen on a lane, \"checkout head\" only checks out components on this lane. to update main components, run \"bit lane merge main\"`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n [\n '',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]',\n ],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n \"only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace\",\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'force-ours', 'regardless of conflicts, ignore theirs changes and keep our local files intact'],\n ['', 'force-theirs', 'regardless of conflicts, ignore our local changes and use theirs files'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n forceOurs,\n forceTheirs,\n autoMergeResolve,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n revert = false,\n }: {\n interactiveMerge?: boolean;\n forceOurs?: boolean;\n forceTheirs?: boolean;\n autoMergeResolve?: MergeStrategy;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n revert?: boolean;\n }\n ) {\n if (forceOurs && forceTheirs) {\n throw new BitError('please use either --force-ours or --force-theirs, not both');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (workspaceOnly && to !== HEAD) {\n throw new BitError('--workspace-only is only relevant when running \"bit checkout head\" on a lane');\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: autoMergeResolve,\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n revert,\n forceOurs,\n forceTheirs,\n };\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else if (to === 'main') checkoutProps.main = true;\n else {\n if (!ComponentID.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n\n const checkoutResults = await this.checkout.checkoutByCLIValues(componentPattern || '', checkoutProps);\n return checkoutOutput(checkoutResults, checkoutProps);\n }\n}\n\nexport function checkoutOutput(\n checkoutResults: ApplyVersionResults,\n checkoutProps: CheckoutProps,\n alternativeTitle?: string\n) {\n const {\n components,\n version,\n failedComponents,\n removedComponents,\n addedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = checkoutResults;\n\n const { head, reset, latest, main, revert, verbose, all } = checkoutProps;\n\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n if (realFailedComponents.length) {\n throw new Error('checkout should throw in case of errors');\n }\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = failedComponents || [];\n\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'checkout was not required for the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.unchangedMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}\\n\\n`;\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\".\nonce ready, snap/tag the components to persist the changes`;\n const conflictSummary = conflictSummaryReport(components);\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n const newLine = '\\n';\n const switchedOrReverted = revert ? 'reverted' : 'switched';\n if (components.length === 1) {\n const component = components[0];\n const componentName = reset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (reset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title =\n alternativeTitle ||\n `successfully ${switchedOrReverted} ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !reset\n head || latest ? component.id.version : version\n )}`;\n return chalk.bold(title) + newLine + applyVersionReport(components, false);\n }\n if (reset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (head) return 'their head version';\n if (latest) return 'their latest version';\n if (main) return 'their main version';\n // @ts-ignore version is defined when !reset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title =\n alternativeTitle || `successfully ${switchedOrReverted} ${components.length} components to ${versionOutput}`;\n const showVersion = head || reset;\n return chalk.bold(title) + newLine + applyVersionReport(components, true, showVersion);\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components exist on the lane but were not added to the workspace. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `\\n\\n${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const newLines = '\\n\\n';\n const title = chalk.bold.underline('Summary');\n const checkedOutStr = `\\nTotal Changed: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return newLines + title + checkedOutStr + unchangedLegitimatelyStr + newOnLaneStr;\n };\n\n return (\n getNotCheckedOutOutput() +\n getSuccessfulOutput() +\n getRemovedOutput(removedComponents) +\n getAddedOutput(addedComponents) +\n getNewOnLaneOutput() +\n getConflictSummary() +\n getSummary() +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError)\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAA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7E,MAAM+B,wBAAwB,GAAI,sBAAqBlC,gBAAK,CAACE,IAAI,CAAC6B,yBAAyB,CAAC5B,QAAQ,CAAC,CAAC,CAAE,EAAC;IACzG,MAAMgC,YAAY,GAAG/C,WAAW,EAAEQ,MAAM,IAAI,CAAC;IAC7C,MAAMwC,iBAAiB,GAAG/C,gBAAgB,GAAG,UAAU,GAAG,cAAc;IACxE,MAAMgD,YAAY,GAAGF,YAAY,GAC5B,gBAAeC,iBAAkB,KAAIpC,gBAAK,CAACE,IAAI,CAACiC,YAAY,CAAChC,QAAQ,CAAC,CAAC,CAAE,EAAC,GAC3E,EAAE;IAEN,OAAO6B,QAAQ,GAAG5B,KAAK,GAAG6B,aAAa,GAAGC,wBAAwB,GAAGG,YAAY;EACnF,CAAC;EAED,OACEtC,sBAAsB,CAAC,CAAC,GACxBmB,mBAAmB,CAAC,CAAC,GACrB,IAAAoB,2BAAgB,EAACrD,iBAAiB,CAAC,GACnC,IAAAsD,yBAAc,EAACrD,eAAe,CAAC,GAC/B0C,kBAAkB,CAAC,CAAC,GACpBhB,kBAAkB,CAAC,CAAC,GACpBiB,UAAU,CAAC,CAAC,GACZ,IAAAW,kCAAuB,EAAClD,iBAAiB,CAAC,GAC1C,IAAAmD,iCAAsB,EAAClD,gBAAgB,CAAC;AAE5C"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_constants","_componentId","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CheckoutCmd","constructor","checkout","name","description","COMPONENT_PATTERN_HELP","report","to","componentPattern","interactiveMerge","forceOurs","forceTheirs","autoMergeResolve","manual","all","workspaceOnly","verbose","skipDependencyInstallation","revert","BitError","HEAD","checkoutProps","promptMergeOptions","mergeStrategy","isLane","skipNpmInstall","head","LATEST","latest","reset","main","ComponentID","isValidVersion","version","checkoutResults","checkoutByCLIValues","checkoutOutput","exports","alternativeTitle","components","failedComponents","removedComponents","addedComponents","leftUnresolvedConflicts","newFromLane","newFromLaneAdded","installationError","compilationError","realFailedComponents","filter","f","unchangedLegitimately","length","Error","notCheckedOutComponents","getNotCheckedOutOutput","chalk","green","bold","toString","title","body","map","failedComponent","id","unchangedMessage","join","underline","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictStr","yellow","getSuccessfulOutput","newLine","switchedOrReverted","component","componentName","toStringWithoutVersion","applyVersionReport","getVerOutput","versionOutput","showVersion","getNewOnLaneOutput","getSummary","checkedOut","notCheckedOutLegitimately","checkedOutStr","unchangedLegitimatelyStr","newOnLaneNum","newOnLaneAddedStr","newOnLaneStr","compact","getRemovedOutput","getAddedOutput","installationErrorOutput","compilationErrorOutput"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport {\n ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n} from '@teambit/merging';\nimport { COMPONENT_PATTERN_HELP, HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { CheckoutMain, CheckoutProps } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout <to> [component-pattern]';\n arguments = [\n {\n name: 'to',\n description:\n \"permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes\",\n },\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n description = 'switch between component versions or remove local changes';\n helpUrl = 'reference/components/merging-changes#checkout-snaps-to-the-working-directory';\n group = 'development';\n extendedDescription = `\n\\`bit checkout <version> [component-pattern]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n\\`bit checkout head [component-pattern]\\` => checkout to the last snap/tag (use --latest if you only want semver tags), omit [component-pattern] to checkout head for all\n\\`bit checkout 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)\nwhen on a lane, \"checkout head\" only checks out components on this lane. to update main components, run \"bit lane merge main\"`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n [\n '',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]',\n ],\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n ['a', 'all', 'all components'],\n [\n 'e',\n 'workspace-only',\n \"only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace\",\n ],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['x', 'skip-dependency-installation', 'do not auto-install dependencies of the imported components'],\n ['', 'force-ours', 'regardless of conflicts, ignore theirs changes and keep our local files intact'],\n ['', 'force-theirs', 'regardless of conflicts, ignore our local changes and use theirs files'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [to, componentPattern]: [string, string],\n {\n interactiveMerge = false,\n forceOurs,\n forceTheirs,\n autoMergeResolve,\n manual,\n all = false,\n workspaceOnly = false,\n verbose = false,\n skipDependencyInstallation = false,\n revert = false,\n }: {\n interactiveMerge?: boolean;\n forceOurs?: boolean;\n forceTheirs?: boolean;\n autoMergeResolve?: MergeStrategy;\n manual?: boolean;\n all?: boolean;\n workspaceOnly?: boolean;\n verbose?: boolean;\n skipDependencyInstallation?: boolean;\n revert?: boolean;\n }\n ) {\n if (forceOurs && forceTheirs) {\n throw new BitError('please use either --force-ours or --force-theirs, not both');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n if (workspaceOnly && to !== HEAD) {\n throw new BitError('--workspace-only is only relevant when running \"bit checkout head\" on a lane');\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: autoMergeResolve,\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n workspaceOnly,\n revert,\n forceOurs,\n forceTheirs,\n };\n if (to === HEAD) checkoutProps.head = true;\n else if (to === LATEST) checkoutProps.latest = true;\n else if (to === 'reset') checkoutProps.reset = true;\n else if (to === 'main') checkoutProps.main = true;\n else {\n if (!ComponentID.isValidVersion(to)) throw new BitError(`the specified version \"${to}\" is not a valid version`);\n checkoutProps.version = to;\n }\n\n const checkoutResults = await this.checkout.checkoutByCLIValues(componentPattern || '', checkoutProps);\n return checkoutOutput(checkoutResults, checkoutProps);\n }\n}\n\nexport function checkoutOutput(\n checkoutResults: ApplyVersionResults,\n checkoutProps: CheckoutProps,\n alternativeTitle?: string\n) {\n const {\n components,\n version,\n failedComponents,\n removedComponents,\n addedComponents,\n leftUnresolvedConflicts,\n newFromLane,\n newFromLaneAdded,\n installationError,\n compilationError,\n }: ApplyVersionResults = checkoutResults;\n\n const { head, reset, latest, main, revert, verbose, all } = checkoutProps;\n\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = (failedComponents || []).filter((f) => !f.unchangedLegitimately);\n if (realFailedComponents.length) {\n throw new Error('checkout should throw in case of errors');\n }\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const notCheckedOutComponents = failedComponents || [];\n\n const getNotCheckedOutOutput = () => {\n if (!notCheckedOutComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n notCheckedOutComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n const title = 'checkout was not required for the following component(s)';\n const body = notCheckedOutComponents\n .map((failedComponent) => `${failedComponent.id.toString()} - ${failedComponent.unchangedMessage}`)\n .join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\".\nonce ready, snap/tag the components to persist the changes`;\n const conflictSummary = conflictSummaryReport(components);\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n const newLine = '\\n';\n const switchedOrReverted = revert ? 'reverted' : 'switched';\n if (components.length === 1) {\n const component = components[0];\n const componentName = reset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (reset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title =\n alternativeTitle ||\n `successfully ${switchedOrReverted} ${chalk.bold(componentName)} to version ${chalk.bold(\n // @ts-ignore version is defined when !reset\n head || latest ? component.id.version : version\n )}`;\n return chalk.bold(title) + newLine + applyVersionReport(components, false);\n }\n if (reset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return chalk.underline(title) + body;\n }\n const getVerOutput = () => {\n if (head) return 'their head version';\n if (latest) return 'their latest version';\n if (main) return 'their main version';\n // @ts-ignore version is defined when !reset\n return `version ${chalk.bold(version)}`;\n };\n const versionOutput = getVerOutput();\n const title =\n alternativeTitle || `successfully ${switchedOrReverted} ${components.length} components to ${versionOutput}`;\n const showVersion = head || reset;\n return chalk.bold(title) + newLine + applyVersionReport(components, true, showVersion);\n };\n const getNewOnLaneOutput = () => {\n if (!newFromLane?.length) return '';\n const title = newFromLaneAdded\n ? `successfully added the following components from the lane`\n : `the following components exist on the lane but were not added to the workspace. omit --workspace-only flag to add them`;\n const body = newFromLane.join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n };\n const getSummary = () => {\n const checkedOut = components?.length || 0;\n const notCheckedOutLegitimately = notCheckedOutComponents.length;\n const title = chalk.bold.underline('Summary');\n const checkedOutStr = `\\nTotal Changed: ${chalk.bold(checkedOut.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(notCheckedOutLegitimately.toString())}`;\n const newOnLaneNum = newFromLane?.length || 0;\n const newOnLaneAddedStr = newFromLaneAdded ? ' (added)' : ' (not added)';\n const newOnLaneStr = newOnLaneNum\n ? `\\nNew on lane${newOnLaneAddedStr}: ${chalk.bold(newOnLaneNum.toString())}`\n : '';\n\n return title + checkedOutStr + unchangedLegitimatelyStr + newOnLaneStr;\n };\n\n return compact([\n getNotCheckedOutOutput(),\n getSuccessfulOutput(),\n getRemovedOutput(removedComponents),\n getAddedOutput(addedComponents),\n getNewOnLaneOutput(),\n getConflictSummary(),\n getSummary(),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n ]).join('\\n\\n');\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAA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 -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/checkout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.139",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/checkout",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "checkout",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.139"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"@teambit/component-id": "1.2.0",
|
|
17
17
|
"@teambit/harmony": "0.4.6",
|
|
18
18
|
"@teambit/cli": "0.0.848",
|
|
19
|
-
"@teambit/merging": "1.0.
|
|
20
|
-
"@teambit/component-writer": "1.0.
|
|
21
|
-
"@teambit/importer": "1.0.
|
|
19
|
+
"@teambit/merging": "1.0.139",
|
|
20
|
+
"@teambit/component-writer": "1.0.139",
|
|
21
|
+
"@teambit/importer": "1.0.139",
|
|
22
22
|
"@teambit/logger": "0.0.941",
|
|
23
|
-
"@teambit/remove": "1.0.
|
|
24
|
-
"@teambit/workspace": "1.0.
|
|
23
|
+
"@teambit/remove": "1.0.139",
|
|
24
|
+
"@teambit/workspace": "1.0.139"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/lodash": "4.14.165",
|
|
File without changes
|