@teambit/checkout 1.0.150 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +2 -2
- package/dist/checkout-version.js +5 -12
- package/dist/checkout-version.js.map +1 -1
- package/dist/checkout.main.runtime.js +3 -10
- package/dist/checkout.main.runtime.js.map +1 -1
- package/package.json +12 -12
- /package/dist/{preview-1706671044097.js → preview-1706757518460.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites>
|
|
3
|
-
<testsuite name="teambit.component/checkout@1.0.
|
|
3
|
+
<testsuite name="teambit.component/checkout@1.0.152" tests="2" failures="0" errors="0" skipped="0">
|
|
4
4
|
<testcase classname="dist/checkout.spec.js" name="should bring the files back"/>
|
|
5
|
-
<testcase classname="dist/checkout.spec.js" name="the workspace should get the component as a valid component" time="0.
|
|
5
|
+
<testcase classname="dist/checkout.spec.js" name="the workspace should get the component as a valid component" time="0.081"/>
|
|
6
6
|
</testsuite>
|
|
7
7
|
</testsuites>
|
package/dist/checkout-version.js
CHANGED
|
@@ -15,13 +15,6 @@ function path() {
|
|
|
15
15
|
};
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
-
function _generalError() {
|
|
19
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
|
|
20
|
-
_generalError = function () {
|
|
21
|
-
return data;
|
|
22
|
-
};
|
|
23
|
-
return data;
|
|
24
|
-
}
|
|
25
18
|
function _path2() {
|
|
26
19
|
const data = require("@teambit/legacy/dist/utils/path");
|
|
27
20
|
_path2 = function () {
|
|
@@ -119,7 +112,7 @@ mergeResults, checkoutProps) {
|
|
|
119
112
|
}
|
|
120
113
|
const component = await consumer.loadComponentFromModelImportIfNeeded(id);
|
|
121
114
|
const componentMap = componentFromFS && componentFromFS.componentMap;
|
|
122
|
-
if (componentFromFS && !componentMap) throw new (
|
|
115
|
+
if (componentFromFS && !componentMap) throw new (_bitError().BitError)('applyVersion: componentMap was not found');
|
|
123
116
|
const files = component.files;
|
|
124
117
|
updateFileStatus(files, filesStatus, componentFromFS || undefined);
|
|
125
118
|
await removeFilesIfNeeded(filesStatus, consumer, componentFromFS || undefined);
|
|
@@ -199,7 +192,7 @@ function applyModifiedVersion(componentFiles, mergeResults, mergeStrategy) {
|
|
|
199
192
|
mergeResults.modifiedFiles.forEach(file => {
|
|
200
193
|
const filePath = path().normalize(file.filePath);
|
|
201
194
|
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
202
|
-
if (!foundFile) throw new (
|
|
195
|
+
if (!foundFile) throw new (_bitError().BitError)(`file ${filePath} not found`);
|
|
203
196
|
if (file.conflict) {
|
|
204
197
|
foundFile.contents = Buffer.from(file.conflict);
|
|
205
198
|
filesStatus[file.filePath] = _mergeVersion().FileStatus.manual;
|
|
@@ -211,7 +204,7 @@ function applyModifiedVersion(componentFiles, mergeResults, mergeStrategy) {
|
|
|
211
204
|
foundFile.contents = file.fsFile.contents;
|
|
212
205
|
filesStatus[file.filePath] = _mergeVersion().FileStatus.binaryConflict;
|
|
213
206
|
} else {
|
|
214
|
-
throw new (
|
|
207
|
+
throw new (_bitError().BitError)(`file ${filePath} does not have output nor conflict`);
|
|
215
208
|
}
|
|
216
209
|
});
|
|
217
210
|
mergeResults.addFiles.forEach(file => {
|
|
@@ -243,14 +236,14 @@ function applyModifiedVersion(componentFiles, mergeResults, mergeStrategy) {
|
|
|
243
236
|
mergeResults.overrideFiles.forEach(file => {
|
|
244
237
|
const filePath = path().normalize(file.filePath);
|
|
245
238
|
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
246
|
-
if (!foundFile) throw new (
|
|
239
|
+
if (!foundFile) throw new (_bitError().BitError)(`file ${filePath} not found`);
|
|
247
240
|
foundFile.contents = file.fsFile.contents;
|
|
248
241
|
filesStatus[file.filePath] = _mergeVersion().FileStatus.overridden;
|
|
249
242
|
});
|
|
250
243
|
mergeResults.updatedFiles.forEach(file => {
|
|
251
244
|
const filePath = path().normalize(file.filePath);
|
|
252
245
|
const foundFile = modifiedFiles.find(componentFile => componentFile.relative === filePath);
|
|
253
|
-
if (!foundFile) throw new (
|
|
246
|
+
if (!foundFile) throw new (_bitError().BitError)(`file ${filePath} not found`);
|
|
254
247
|
foundFile.contents = file.content;
|
|
255
248
|
filesStatus[file.filePath] = _mergeVersion().FileStatus.updated;
|
|
256
249
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","data","_interopRequireWildcard","require","_generalError","_interopRequireDefault","_path2","_dataToPersist","_removePath","_mergeVersion","_bitError","_chalk","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","forceOurs","filesStatus","hasConflicts","MergeOptions","ours","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","GeneralError","updateFileStatus","undefined","removeFilesIfNeeded","modifiedStatus","modifiedFiles","applyModifiedVersion","fileFromFs","find","f","areFilesEqual","Buffer","compare","contents","updated","isExistOnFs","getComponentIdIfExist","ignoreVersion","filePathsFromFS","dataToPersist","DataToPersist","filename","removed","removePath","RemovePath","persistAllToFS","componentFiles","map","clone","manual","filePath","normalize","foundFile","componentFile","conflict","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","added","deletedConflictFiles","removeFiles","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","failedComponent","chalk","bold","red","join","BitError"],"sources":["checkout-version.ts"],"sourcesContent":["import * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentID } from '@teambit/component-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 { FileStatus, MergeOptions, MergeStrategy } 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';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { ApplyVersionResult, FilesStatus } from '@teambit/merging';\nimport { CheckoutProps } from './checkout.main.runtime';\n\nexport type ComponentStatusBase = {\n currentComponent?: ConsumerComponent;\n componentFromModel?: Version;\n id: ComponentID;\n shouldBeRemoved?: boolean; // in case the component is soft-removed, it should be removed from the workspace\n unchangedMessage?: string; // this gets populated either upon skip or failure.\n unchangedLegitimately?: boolean; // true for skipped legitimately (e.g. already up to date). false for failure.\n};\n\nexport type ComponentStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\nexport type ApplyVersionWithComps = {\n applyVersionResult: ApplyVersionResult;\n component?: ConsumerComponent;\n // in case the component needs to be written to the filesystem, this is the component to write.\n legacyCompToWrite?: ConsumerComponent;\n};\n\n/**\n * This function optionally returns \"component\" object. If it returns, it means it needs to be written to the filesystem.\n * Otherwise, it means the component is already up to date and no need to write it.\n *\n * If no need to change anything (ours), then don't return the component object.\n * Otherwise, either return the component object as is (if no conflicts or \"theirs\"), or change the files in this\n * component object. Later, this component object is written to the filesystem.\n *\n * 1) when the files are modified with conflicts and the strategy is \"ours\", or forceOurs was used, leave the FS as is.\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", or forceTheirs was used, write the\n * component according to \"component\" object\n *\n * 3) when files are modified with no conflict or files are modified with conflicts and the\n * strategy is manual, load the component according to id.version and update component.files.\n * applyModifiedVersion() docs explains what files are updated/added.\n *\n * Side note:\n * Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).\n * Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles\n */\nexport async function applyVersion(\n consumer: Consumer,\n id: ComponentID,\n componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true\n mergeResults: MergeResultsThreeWay | null | undefined,\n checkoutProps: CheckoutProps\n): Promise<ApplyVersionWithComps> {\n if (!checkoutProps.isLane && !componentFromFS)\n throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n const { mergeStrategy, forceOurs } = checkoutProps;\n let filesStatus = {};\n if ((mergeResults?.hasConflicts && mergeStrategy === MergeOptions.ours) || forceOurs) {\n // even when isLane is true, the mergeResults is possible only when the component is on the filesystem\n // otherwise it's impossible to have conflicts\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n consumer.bitMap.updateComponentId(id);\n return { applyVersionResult: { id, filesStatus } };\n }\n const component = await consumer.loadComponentFromModelImportIfNeeded(id);\n const componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new GeneralError('applyVersion: componentMap was not found');\n\n const files = component.files;\n updateFileStatus(files, filesStatus, componentFromFS || undefined);\n\n await removeFilesIfNeeded(filesStatus, consumer, componentFromFS || undefined);\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n filesStatus = { ...filesStatus, ...modifiedStatus };\n component.files = modifiedFiles;\n }\n\n // in case of forceTheirs, the mergeResults is undefined, the \"component\" object is according to \"theirs\", so it'll work\n // expected. (later, it writes the component object).\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\nexport function updateFileStatus(files: SourceFile[], filesStatus: FilesStatus, componentFromFS?: ConsumerComponent) {\n files.forEach((file) => {\n const fileFromFs = componentFromFS?.files.find((f) => f.relative === file.relative);\n const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;\n // @ts-ignore\n filesStatus[pathNormalizeToLinux(file.relative)] = areFilesEqual ? FileStatus.unchanged : FileStatus.updated;\n });\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * without this function, these files would be left on the filesystem. (we don't delete the comp-dir before writing).\n * this needs to be done *before* the component is written to the filesystem, otherwise, it won't work when a file\n * has a case change. e.g. from uppercase to lowercase. (see merge-lane.e2e 'renaming files from uppercase to lowercase').\n */\nexport async function removeFilesIfNeeded(\n filesStatus: FilesStatus,\n consumer: Consumer,\n componentFromFS?: ConsumerComponent\n) {\n if (!componentFromFS) return;\n // @todo: if the component is not in the FS, it should be passed as undefined here.\n // in the case this is coming from merge-lane, it's sometimes populated from the scope.\n const isExistOnFs = consumer.bitMap.getComponentIdIfExist(componentFromFS.id, { ignoreVersion: true });\n if (!isExistOnFs) return;\n const filePathsFromFS = componentFromFS.files || [];\n const dataToPersist = new DataToPersist();\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!filesStatus[filename]) {\n // @ts-ignore todo: typescript has a good point here. it should be the string \"removed\", not chalk.green(removed).\n filesStatus[filename] = FileStatus.removed;\n dataToPersist.removePath(new RemovePath(file.path));\n }\n });\n await dataToPersist.persistAllToFS();\n}\n\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new 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\nexport function throwForFailures(allComponentsStatus: ComponentStatusBase[]) {\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to proceed due to the following failures:\\n${failureMsgs}`);\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA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E,SAAS,CAACnB,QAAQ,GAAGxB,IAAI,CAAC+D,OAAO;IACjCpE,WAAW,CAACK,IAAI,CAACyC,QAAQ,CAAC,GAAGtC,0BAAU,CAACsB,OAAO;EACjD,CAAC,CAAC;EAEF,OAAO;IAAE9B,WAAW;IAAEqB;EAAc,CAAC;AACvC;AAEO,SAASgD,gBAAgBA,CAACC,mBAA0C,EAAE;EAC3E,MAAMC,gBAAgB,GAAGD,mBAAmB,CAACvG,MAAM,CAAEyG,CAAC,IAAKA,CAAC,CAACC,gBAAgB,IAAI,CAACD,CAAC,CAACE,qBAAqB,CAAC;EAC1G,IAAIH,gBAAgB,CAAClG,MAAM,EAAE;IAC3B,MAAMsG,WAAW,GAAGJ,gBAAgB,CACjC5B,GAAG,CACDiC,eAAe,IACb,GAAEC,gBAAK,CAACC,IAAI,CAACF,eAAe,CAACrF,EAAE,CAACM,QAAQ,CAAC,CAAC,CAAE,MAAKgF,gBAAK,CAACE,GAAG,CAACH,eAAe,CAACH,gBAA0B,CAAE,EAC5G,CAAC,CACAO,IAAI,CAAC,IAAI,CAAC;IACb,MAAM,KAAIC,oBAAQ,EAAE,qDAAoDN,WAAY,EAAC,CAAC;EACxF;AACF"}
|
|
1
|
+
{"version":3,"names":["path","data","_interopRequireWildcard","require","_path2","_dataToPersist","_interopRequireDefault","_removePath","_mergeVersion","_bitError","_chalk","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","applyVersion","consumer","id","componentFromFS","mergeResults","checkoutProps","isLane","Error","toString","mergeStrategy","forceOurs","filesStatus","hasConflicts","MergeOptions","ours","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","bitMap","updateComponentId","applyVersionResult","component","loadComponentFromModelImportIfNeeded","componentMap","BitError","updateFileStatus","undefined","removeFilesIfNeeded","modifiedStatus","modifiedFiles","applyModifiedVersion","fileFromFs","find","f","areFilesEqual","Buffer","compare","contents","updated","isExistOnFs","getComponentIdIfExist","ignoreVersion","filePathsFromFS","dataToPersist","DataToPersist","filename","removed","removePath","RemovePath","persistAllToFS","componentFiles","map","clone","manual","filePath","normalize","foundFile","componentFile","conflict","from","output","merged","isBinaryConflict","fsFile","binaryConflict","addFiles","m","added","deletedConflictFiles","removeFiles","remainDeletedFiles","remainDeleted","deletedConflict","overrideFiles","overridden","updatedFiles","content","throwForFailures","allComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","failedComponent","chalk","bold","red","join"],"sources":["checkout-version.ts"],"sourcesContent":["import * as path from 'path';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentID } from '@teambit/component-id';\nimport Version from '@teambit/legacy/dist/scope/models/version';\nimport { SourceFile } 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 { FileStatus, MergeOptions, MergeStrategy } 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';\nimport { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { ApplyVersionResult, FilesStatus } from '@teambit/merging';\nimport { CheckoutProps } from './checkout.main.runtime';\n\nexport type ComponentStatusBase = {\n currentComponent?: ConsumerComponent;\n componentFromModel?: Version;\n id: ComponentID;\n shouldBeRemoved?: boolean; // in case the component is soft-removed, it should be removed from the workspace\n unchangedMessage?: string; // this gets populated either upon skip or failure.\n unchangedLegitimately?: boolean; // true for skipped legitimately (e.g. already up to date). false for failure.\n};\n\nexport type ComponentStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null | undefined;\n};\n\nexport type ApplyVersionWithComps = {\n applyVersionResult: ApplyVersionResult;\n component?: ConsumerComponent;\n // in case the component needs to be written to the filesystem, this is the component to write.\n legacyCompToWrite?: ConsumerComponent;\n};\n\n/**\n * This function optionally returns \"component\" object. If it returns, it means it needs to be written to the filesystem.\n * Otherwise, it means the component is already up to date and no need to write it.\n *\n * If no need to change anything (ours), then don't return the component object.\n * Otherwise, either return the component object as is (if no conflicts or \"theirs\"), or change the files in this\n * component object. Later, this component object is written to the filesystem.\n *\n * 1) when the files are modified with conflicts and the strategy is \"ours\", or forceOurs was used, leave the FS as is.\n *\n * 2) when the files are modified with conflicts and the strategy is \"theirs\", or forceTheirs was used, write the\n * component according to \"component\" object\n *\n * 3) when files are modified with no conflict or files are modified with conflicts and the\n * strategy is manual, load the component according to id.version and update component.files.\n * applyModifiedVersion() docs explains what files are updated/added.\n *\n * Side note:\n * Deleted file => if files are in used version but not in the modified one, no need to delete it. (similar to git).\n * Added file => if files are not in used version but in the modified one, they'll be under mergeResults.addFiles\n */\nexport async function applyVersion(\n consumer: Consumer,\n id: ComponentID,\n componentFromFS: ConsumerComponent | null | undefined, // it can be null only when isLanes is true\n mergeResults: MergeResultsThreeWay | null | undefined,\n checkoutProps: CheckoutProps\n): Promise<ApplyVersionWithComps> {\n if (!checkoutProps.isLane && !componentFromFS)\n throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n const { mergeStrategy, forceOurs } = checkoutProps;\n let filesStatus = {};\n if ((mergeResults?.hasConflicts && mergeStrategy === MergeOptions.ours) || forceOurs) {\n // even when isLane is true, the mergeResults is possible only when the component is on the filesystem\n // otherwise it's impossible to have conflicts\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n consumer.bitMap.updateComponentId(id);\n return { applyVersionResult: { id, filesStatus } };\n }\n const component = await consumer.loadComponentFromModelImportIfNeeded(id);\n const componentMap = componentFromFS && componentFromFS.componentMap;\n if (componentFromFS && !componentMap) throw new BitError('applyVersion: componentMap was not found');\n\n const files = component.files;\n updateFileStatus(files, filesStatus, componentFromFS || undefined);\n\n await removeFilesIfNeeded(filesStatus, consumer, componentFromFS || undefined);\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n filesStatus = { ...filesStatus, ...modifiedStatus };\n component.files = modifiedFiles;\n }\n\n // in case of forceTheirs, the mergeResults is undefined, the \"component\" object is according to \"theirs\", so it'll work\n // expected. (later, it writes the component object).\n\n return {\n applyVersionResult: { id, filesStatus },\n component,\n };\n}\n\nexport function updateFileStatus(files: SourceFile[], filesStatus: FilesStatus, componentFromFS?: ConsumerComponent) {\n files.forEach((file) => {\n const fileFromFs = componentFromFS?.files.find((f) => f.relative === file.relative);\n const areFilesEqual = fileFromFs && Buffer.compare(fileFromFs.contents, file.contents) === 0;\n // @ts-ignore\n filesStatus[pathNormalizeToLinux(file.relative)] = areFilesEqual ? FileStatus.unchanged : FileStatus.updated;\n });\n}\n\n/**\n * when files exist on the filesystem but not on the checked out versions, they need to be deleted.\n * without this function, these files would be left on the filesystem. (we don't delete the comp-dir before writing).\n * this needs to be done *before* the component is written to the filesystem, otherwise, it won't work when a file\n * has a case change. e.g. from uppercase to lowercase. (see merge-lane.e2e 'renaming files from uppercase to lowercase').\n */\nexport async function removeFilesIfNeeded(\n filesStatus: FilesStatus,\n consumer: Consumer,\n componentFromFS?: ConsumerComponent\n) {\n if (!componentFromFS) return;\n // @todo: if the component is not in the FS, it should be passed as undefined here.\n // in the case this is coming from merge-lane, it's sometimes populated from the scope.\n const isExistOnFs = consumer.bitMap.getComponentIdIfExist(componentFromFS.id, { ignoreVersion: true });\n if (!isExistOnFs) return;\n const filePathsFromFS = componentFromFS.files || [];\n const dataToPersist = new DataToPersist();\n filePathsFromFS.forEach((file) => {\n const filename = pathNormalizeToLinux(file.relative);\n if (!filesStatus[filename]) {\n // @ts-ignore todo: typescript has a good point here. it should be the string \"removed\", not chalk.green(removed).\n filesStatus[filename] = FileStatus.removed;\n dataToPersist.removePath(new RemovePath(file.path));\n }\n });\n await dataToPersist.persistAllToFS();\n}\n\n/**\n * relevant only when\n * 1) there is no conflict => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.output.\n * 2) there is conflict and mergeStrategy is manual => add files from mergeResults: addFiles, overrideFiles and modifiedFiles.conflict.\n *\n * this function only updates the files content, it doesn't write the files\n */\nexport function applyModifiedVersion(\n componentFiles: SourceFile[],\n mergeResults: MergeResultsThreeWay,\n mergeStrategy: MergeStrategy | null | undefined\n): { filesStatus: Record<string, any>; modifiedFiles: SourceFile[] } {\n let modifiedFiles = componentFiles.map((file) => file.clone());\n const filesStatus = {};\n if (mergeResults.hasConflicts && mergeStrategy !== MergeOptions.manual) {\n return { filesStatus, modifiedFiles };\n }\n mergeResults.modifiedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n if (file.conflict) {\n foundFile.contents = Buffer.from(file.conflict);\n filesStatus[file.filePath] = FileStatus.manual;\n } else if (typeof file.output === 'string') {\n foundFile.contents = Buffer.from(file.output);\n filesStatus[file.filePath] = FileStatus.merged;\n } else if (file.isBinaryConflict) {\n // leave the file as is and notify the user later about it.\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.binaryConflict;\n } else {\n throw new BitError(`file ${filePath} does not have output nor conflict`);\n }\n });\n\n mergeResults.addFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n if (!file.fsFile) return;\n const filePath: PathOsBased = path.normalize(file.filePath);\n if (modifiedFiles.find((m) => m.relative === filePath)) return;\n modifiedFiles.push(file.fsFile);\n filesStatus[file.filePath] = FileStatus.added;\n });\n mergeResults.removeFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n filesStatus[file.filePath] = FileStatus.removed;\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n });\n mergeResults.remainDeletedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n modifiedFiles = modifiedFiles.filter((f) => f.relative !== filePath);\n filesStatus[file.filePath] = FileStatus.remainDeleted;\n });\n mergeResults.deletedConflictFiles.forEach((file) => {\n filesStatus[file.filePath] = FileStatus.deletedConflict;\n });\n\n mergeResults.overrideFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.fsFile.contents;\n filesStatus[file.filePath] = FileStatus.overridden;\n });\n mergeResults.updatedFiles.forEach((file) => {\n const filePath: PathOsBased = path.normalize(file.filePath);\n const foundFile = modifiedFiles.find((componentFile) => componentFile.relative === filePath);\n if (!foundFile) throw new BitError(`file ${filePath} not found`);\n foundFile.contents = file.content;\n filesStatus[file.filePath] = FileStatus.updated;\n });\n\n return { filesStatus, modifiedFiles };\n}\n\nexport function throwForFailures(allComponentsStatus: ComponentStatusBase[]) {\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`un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,CAAC;IAC3D,MAAME,SAAS,GAAG3B,aAAa,CAACG,IAAI,CAAEyB,aAAa,IAAKA,aAAa,CAAC1C,QAAQ,KAAKuC,QAAQ,CAAC;IAC5F,IAAI,CAACE,SAAS,EAAE,MAAM,KAAIhC,oBAAQ,EAAE,QAAO8B,QAAS,YAAW,CAAC;IAChEE,SAAS,CAACnB,QAAQ,GAAGxB,IAAI,CAAC+D,OAAO;IACjCpE,WAAW,CAACK,IAAI,CAACyC,QAAQ,CAAC,GAAGtC,0BAAU,CAACsB,OAAO;EACjD,CAAC,CAAC;EAEF,OAAO;IAAE9B,WAAW;IAAEqB;EAAc,CAAC;AACvC;AAEO,SAASgD,gBAAgBA,CAACC,mBAA0C,EAAE;EAC3E,MAAMC,gBAAgB,GAAGD,mBAAmB,CAACvG,MAAM,CAAEyG,CAAC,IAAKA,CAAC,CAACC,gBAAgB,IAAI,CAACD,CAAC,CAACE,qBAAqB,CAAC;EAC1G,IAAIH,gBAAgB,CAAClG,MAAM,EAAE;IAC3B,MAAMsG,WAAW,GAAGJ,gBAAgB,CACjC5B,GAAG,CACDiC,eAAe,IACb,GAAEC,gBAAK,CAACC,IAAI,CAACF,eAAe,CAACrF,EAAE,CAACM,QAAQ,CAAC,CAAC,CAAE,MAAKgF,gBAAK,CAACE,GAAG,CAACH,eAAe,CAACH,gBAA0B,CAAE,EAC5G,CAAC,CACAO,IAAI,CAAC,IAAI,CAAC;IACb,MAAM,KAAIhE,oBAAQ,EAAE,qDAAoD2D,WAAY,EAAC,CAAC;EACxF;AACF"}
|
|
@@ -81,13 +81,6 @@ function _mergeVersion() {
|
|
|
81
81
|
};
|
|
82
82
|
return data;
|
|
83
83
|
}
|
|
84
|
-
function _generalError() {
|
|
85
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
|
|
86
|
-
_generalError = function () {
|
|
87
|
-
return data;
|
|
88
|
-
};
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
84
|
function _pMapSeries() {
|
|
92
85
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
93
86
|
_pMapSeries = function () {
|
|
@@ -203,7 +196,7 @@ class CheckoutMain {
|
|
|
203
196
|
const componentWithConflict = allComponentsStatus.find(component => component.mergeResults && component.mergeResults.hasConflicts);
|
|
204
197
|
if (componentWithConflict) {
|
|
205
198
|
if (!promptMergeOptions && !checkoutProps.mergeStrategy) {
|
|
206
|
-
throw new (
|
|
199
|
+
throw new (_bitError().BitError)(`automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\nplease use "--auto-merge-resolve" with 'manual', 'ours' or 'theirs' to resolve the conflict/s`);
|
|
207
200
|
}
|
|
208
201
|
if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await (0, _mergeVersion().getMergeStrategyInteractive)();
|
|
209
202
|
}
|
|
@@ -353,10 +346,10 @@ class CheckoutMain {
|
|
|
353
346
|
checkoutProps.all = true;
|
|
354
347
|
}
|
|
355
348
|
if (componentPattern && checkoutProps.all) {
|
|
356
|
-
throw new (
|
|
349
|
+
throw new (_bitError().BitError)('please specify either [component-pattern] or --all, not both');
|
|
357
350
|
}
|
|
358
351
|
if (!componentPattern && !checkoutProps.all) {
|
|
359
|
-
throw new (
|
|
352
|
+
throw new (_bitError().BitError)('please specify [component-pattern] or use --all flag');
|
|
360
353
|
}
|
|
361
354
|
if (checkoutProps.workspaceOnly && !checkoutProps.head) {
|
|
362
355
|
throw new (_bitError().BitError)(`--workspace-only flag can only be used with "head" (bit checkout head --workspace-only)`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_bitError","_lodash","_loaderMessages","_remove","_interopRequireDefault","_importer","_constants","_componentWriter","_mergeVersion","_generalError","_pMapSeries","_componentId","_repositories","_componentNotFoundInPath","_checkoutCmd","_checkout","_checkoutVersion","_revertCmd","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","CheckoutMain","constructor","workspace","logger","componentWriter","importer","remove","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","addedComponents","restoreMissingComponents","bitIds","ComponentIdList","fromArray","map","id","allComponentStatusBeforeMerge","mapSeries","getComponentStatusBeforeMergeAttempt","compsNeedMerge","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importWithoutDeps","cache","lane","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","Promise","all","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","mergeStrategy","GeneralError","toStringWithoutVersion","getMergeStrategyInteractive","throwForFailures","failedComponents","componentStatus","unchangedMessage","shouldBeRemoved","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","currentComponent","applyVersion","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","manyComponentsWriterOpts","components","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","skipUpdatingBitMap","skipUpdatingBitmap","revert","reasonForBitmapChange","writeMany","appliedVersionComponents","applyVersionResult","componentIdsToRemove","undefined","removeLocallyByIds","force","reasonForRemoval","removedComponents","toString","installationError","compilationError","missing","bitMapEntry","bitMap","getBitmapEntry","ignoreVersion","noFilesError","ComponentNotFoundInPath","comps","getMany","state","_consumer","checkoutByCLIValues","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","importCurrentObjects","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","isExported","changeScope","scopeComponentsImporter","toVersionLatest","reason","includeUnexported","error","unavailableOnMain","getUnavailableOnMainComponents","makeComponentsAvailableOnMain","console","HEAD","latest","LATEST","BitError","includeLocallyDeleted","getIds","idsByPattern","includeDeleted","listIdsIncludeRemoved","listIds","idsOnWorkspace","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","main","latestVersion","versionPerId","forceOurs","forceTheirs","repo","objects","existingBitMapId","getComponentIdIfExist","getComponent","results","loadComponents","allowAddingComponentsFromScope","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","getNewVersion","headIncludeRemote","latestVersionIfExist","newVersion","hasVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","isModified","currentVersionObject","loadVersion","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","componentFromFS","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","RevertCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { ApplyVersionResults, FailedComponents } 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 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 { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Version, ModelComponent, Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ComponentNotFoundInPath from '@teambit/legacy/dist/consumer/component/exceptions/component-not-found-in-path';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, ComponentStatus, ComponentStatusBase, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\n\nexport type CheckoutProps = {\n version?: string; // if reset/head/latest is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n main?: boolean; // relevant for \"revert\" only\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null; // strategy to use in case of conflicts\n forceOurs?: boolean; // regardless of conflicts, use ours\n forceTheirs?: boolean; // regardless of conflicts, use theirs\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n revert?: boolean; // change the files according to the given version, but don't change the bitmap version and don't try to merge\n all?: boolean; // checkout all ids\n isLane?: boolean;\n lane?: Lane; // currently needed for \"bit switch\" to tell the \"fetch\" where to fetch from\n workspaceOnly?: boolean;\n versionPerId?: ComponentID[]; // if given, the ComponentID.version is the version to checkout to.\n skipUpdatingBitmap?: boolean; // needed for stash\n restoreMissingComponents?: boolean; // in case .bitmap has a component and it's missing from the workspace, restore it (from model)\n allowAddingComponentsFromScope?: boolean; // in case the id doesn't exist in .bitmap, add it from the scope (relevant for switch)\n includeLocallyDeleted?: boolean; // include components that were deleted locally. currently enabled for \"bit checkout reset\" only.\n};\n\nexport type ComponentStatusBeforeMergeAttempt = ComponentStatusBase & {\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private remove: RemoveMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n const addedComponents = await this.restoreMissingComponents(checkoutProps);\n const bitIds = ComponentIdList.fromArray(ids?.map((id) => id) || []);\n // don't use Promise.all, it loads the components and this operation must be in sequence.\n const allComponentStatusBeforeMerge = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, checkoutProps)\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n cache: true,\n lane: checkoutProps.lane,\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\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 \"--auto-merge-resolve\" with 'manual', 'ours' or 'theirs' to resolve the conflict/s`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n\n throwForFailures(allComponentsStatus);\n\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, currentComponent, mergeResults }) => {\n return applyVersion(consumer, id, currentComponent, mergeResults, checkoutPropsLegacy);\n });\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n skipUpdatingBitMap: checkoutProps.skipUpdatingBitmap || checkoutProps.revert,\n reasonForBitmapChange: 'checkout',\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n const componentIdsToRemove = allComponentsStatus\n .filter((componentStatus) => componentStatus.shouldBeRemoved)\n .map((c) => c.id.changeVersion(undefined));\n\n if (componentIdsToRemove.length) {\n await this.remove.removeLocallyByIds(componentIdsToRemove, { force: true, reasonForRemoval: 'checkout' });\n }\n\n return {\n components: appliedVersionComponents,\n removedComponents: componentIdsToRemove,\n addedComponents,\n 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 /**\n * if .bitmap entry exists but the rootDir is missing from the filesystem, find the component in the scope and restore it.\n * returns the restored component ids.\n */\n async restoreMissingComponents(checkoutProps: CheckoutProps): Promise<ComponentID[] | undefined> {\n if (checkoutProps.reset) {\n checkoutProps.restoreMissingComponents = true;\n }\n if (!checkoutProps.restoreMissingComponents) return undefined;\n const ids = checkoutProps.ids || [];\n const missing: ComponentID[] = [];\n await Promise.all(\n ids.map(async (id) => {\n const bitMapEntry = this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true });\n if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof ComponentNotFoundInPath) {\n delete bitMapEntry.noFilesError;\n missing.push(id);\n }\n })\n );\n if (!missing.length) return undefined;\n const comps = await this.workspace.scope.getMany(missing);\n await this.componentWriter.writeMany({\n components: comps.map((c) => c.state._consumer),\n skipDependencyInstallation: true,\n skipUpdatingBitMap: true,\n });\n\n return missing;\n }\n\n async checkoutByCLIValues(componentPattern: string, checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const { revert, head } = checkoutProps;\n this.logger.setStatusLine(revert ? 'reverting components...' : BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n if (head) await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy(`checkout (${componentPattern})`);\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !this.workspace.isExported(id)).map((id) => id.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importWithoutDeps(ComponentIdList.fromArray(notExported || []).toVersionLatest(), {\n cache: false,\n reason: 'for making sure the new components are really new and are not out-of-sync',\n includeUnexported: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new 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 if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n\n const getIds = async () => {\n if (componentPattern) {\n return this.workspace.idsByPattern(componentPattern, true, {\n includeDeleted: checkoutProps.includeLocallyDeleted,\n });\n }\n return checkoutProps.includeLocallyDeleted ? this.workspace.listIdsIncludeRemoved() : this.workspace.listIds();\n };\n\n const idsOnWorkspace = await getIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id)) : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id.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 // eslint-disable-next-line complexity\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const {\n version,\n head: headVersion,\n reset,\n revert,\n main,\n latest: latestVersion,\n versionPerId,\n forceOurs,\n forceTheirs,\n } = checkoutProps;\n const repo = consumer.scope.objects;\n\n let existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const getComponent = async () => {\n try {\n const results = await consumer.loadComponents(ComponentIdList.fromArray([id]));\n if (results.components[0]) return results.components[0];\n if (checkoutProps.includeLocallyDeleted && results.removedComponents[0]) {\n return results.removedComponents[0];\n }\n } catch (err) {\n if (checkoutProps.allowAddingComponentsFromScope && !existingBitMapId) return undefined;\n throw err;\n }\n return undefined;\n };\n const component = await getComponent();\n if (component) {\n // the component might fix an out-of-sync issue and as a result, the id has changed\n id = component.id;\n existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n }\n\n const componentModel = await consumer.scope.getModelComponentIfExist(id);\n const componentStatus: ComponentStatusBeforeMergeAttempt = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${id.toString()} is new, no version to checkout`, true);\n }\n if (main && !componentModel.head) {\n return returnFailure(`component ${id.toString()} is not available on main`);\n }\n const unmerged = repo.unmergedComponents.getEntry(id);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n\n const getNewVersion = async (): Promise<string> => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (reset) return component!.id.version as string;\n if (headVersion) return componentModel.headIncludeRemote(repo);\n // we verified previously that head exists in case of \"main\"\n if (main) return componentModel.head?.toString() as string;\n if (latestVersion) {\n const latest = componentModel.latestVersionIfExist();\n return latest || componentModel.headIncludeRemote(repo);\n }\n if (versionPerId) {\n return versionPerId.find((bitId) => bitId.isEqualWithoutVersion(id))?.version as string;\n }\n\n // if all above are false, the version is defined\n return version as string;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion) return returnFailure(`component ${id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const currentlyUsedVersion = existingBitMapId?.version;\n if (existingBitMapId && !currentlyUsedVersion) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n if (!reset) {\n const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);\n const isMergePending = divergeDataForMergePending.isDiverged();\n if (isMergePending) {\n return returnFailure(`component is merge-pending and cannot be checked out, run \"bit status\" for more info`);\n }\n }\n let isModified = false;\n if (currentlyUsedVersion) {\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n isModified = await consumer.isComponentModified(currentVersionObject, component!);\n const isRemoved = component && component.isRemoved();\n if (!isModified && !isRemoved && reset) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not modified`, true);\n }\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version | undefined;\n if (componentVersion?.isRemoved()) {\n if (existingBitMapId) componentStatus.shouldBeRemoved = true;\n return returnFailure(`component has been removed`, true);\n }\n\n const newId = id.changeVersion(newVersion);\n\n if (reset || !isModified || revert || !currentlyUsedVersion || forceTheirs || forceOurs) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n\n // if !currentlyUsedVersion it only exists in the model, so just write it. (happening during bit-switch/bit-lane-import)\n return { currentComponent: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { currentComponent: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n currentComponent: componentFromFS,\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 { currentComponent: componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect, RemoveAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer, remove]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer, remove);\n cli.register(new CheckoutCmd(checkoutMain), new RevertCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,eAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAS,sBAAA,CAAAR,OAAA;EAAAO,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAU,UAAA;EAAA,MAAAV,IAAA,GAAAS,sBAAA,CAAAR,OAAA;EAAAS,SAAA,Y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AU;MACtBtH,gBAAgB,EAAEwI,eAAe;MACjCM,YAAY,EAAG,GAAEnL,oBAAqB,WAAU;MAChD+K;IACF,CAAC,CAAC;IAEF,OAAO;MAAE1I,gBAAgB,EAAEwI,eAAe;MAAED,kBAAkB;MAAExL,EAAE;MAAEkC;IAAa,CAAC;EACpF;EAOA,aAAa8J,QAAQA,CAAC,CAACC,GAAG,EAAEnN,SAAS,EAAEoN,UAAU,EAAEC,UAAU,EAAElN,QAAQ,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMH,MAAM,GAAGmN,UAAU,CAACE,YAAY,CAACC,0BAAc,CAACrM,EAAE,CAAC;IACzD,MAAMsM,YAAY,GAAG,IAAI1N,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAEoN,UAAU,EAAElN,QAAQ,EAAEC,MAAM,CAAC;IACtF+M,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,EAAE,KAAIG,sBAAS,EAACH,YAAY,CAAC,CAAC;IACxE,OAAOA,YAAY;EACrB;AACF;AAACI,OAAA,CAAA9N,YAAA,GAAAA,YAAA;AAAAd,eAAA,CA3cYc,YAAY,WAybR,EAAE;AAAAd,eAAA,CAzbNc,YAAY,kBA0bD,CAAC+N,gBAAS,EAAEC,oBAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,mBAAc,EAAEC,iBAAY,CAAC;AAAAlP,eAAA,CA1b1Gc,YAAY,aA4bNqO,kBAAW;AAiB9BZ,0BAAc,CAACa,UAAU,CAACtO,YAAY,CAAC;AAAC,IAAAuO,QAAA,GAAAT,OAAA,CAAA5Q,OAAA,GAEzB8C,YAAY"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_bitError","_lodash","_loaderMessages","_remove","_interopRequireDefault","_importer","_constants","_componentWriter","_mergeVersion","_pMapSeries","_componentId","_repositories","_componentNotFoundInPath","_checkoutCmd","_checkout","_checkoutVersion","_revertCmd","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","CheckoutMain","constructor","workspace","logger","componentWriter","importer","remove","checkout","checkoutProps","consumer","version","ids","promptMergeOptions","syncNewComponents","addedComponents","restoreMissingComponents","bitIds","ComponentIdList","fromArray","map","id","allComponentStatusBeforeMerge","mapSeries","getComponentStatusBeforeMergeAttempt","compsNeedMerge","c","propsForMerge","compsNotNeedMerge","toImport","compStatus","idsToImport","changeVersion","currentlyUsedVersion","flat","scope","legacyScope","scopeImporter","importWithoutDeps","cache","lane","getComponentsStatusOfMergeNeeded","tmp","Tmp","afterMergeAttempt","Promise","all","getMergeStatus","clear","err","compStatusMergeNeeded","allComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","mergeStrategy","BitError","toStringWithoutVersion","getMergeStrategyInteractive","throwForFailures","failedComponents","componentStatus","unchangedMessage","shouldBeRemoved","unchangedLegitimately","succeededComponents","checkoutPropsLegacy","componentsResults","currentComponent","applyVersion","componentsLegacy","compact","newFromLane","newFromLaneAdded","head","getNewComponentsFromLane","workspaceOnly","compsNewFromLane","loadComponentFromModelImportIfNeeded","leftUnresolvedConflicts","componentWriterResults","manyComponentsWriterOpts","components","skipDependencyInstallation","skipNpmInstall","verbose","resetConfig","reset","skipUpdatingBitMap","skipUpdatingBitmap","revert","reasonForBitmapChange","writeMany","appliedVersionComponents","applyVersionResult","componentIdsToRemove","undefined","removeLocallyByIds","force","reasonForRemoval","removedComponents","toString","installationError","compilationError","missing","bitMapEntry","bitMap","getBitmapEntry","ignoreVersion","noFilesError","ComponentNotFoundInPath","comps","getMany","state","_consumer","checkoutByCLIValues","componentPattern","setStatusLine","BEFORE_CHECKOUT","OutsideWorkspaceError","importCurrentObjects","makeLaneComponentsAvailableOnMain","parseValues","checkoutResults","onDestroy","notExported","isExported","changeScope","scopeComponentsImporter","toVersionLatest","reason","includeUnexported","error","unavailableOnMain","getUnavailableOnMainComponents","makeComponentsAvailableOnMain","console","HEAD","latest","LATEST","includeLocallyDeleted","getIds","idsByPattern","includeDeleted","listIdsIncludeRemoved","listIds","idsOnWorkspace","currentLane","getCurrentLaneObject","currentLaneIds","toBitIds","hasWithoutVersion","laneBitIds","newIds","bitId","isEqualWithoutVersion","newComponentIds","resolveMultipleComponentIds","nonRemovedNewIds","isRemoved","isComponentRemoved","headVersion","main","latestVersion","versionPerId","forceOurs","forceTheirs","repo","objects","existingBitMapId","getComponentIdIfExist","getComponent","results","loadComponents","allowAddingComponentsFromScope","componentModel","getModelComponentIfExist","returnFailure","msg","unmerged","unmergedComponents","getEntry","getNewVersion","headIncludeRemote","latestVersionIfExist","newVersion","hasVersion","divergeDataForMergePending","getDivergeDataForMergePending","isMergePending","isDiverged","isModified","currentVersionObject","loadVersion","isComponentModified","versionRef","getRef","Error","componentVersion","getObject","hash","newId","componentFromModel","componentFromFS","baseVersion","baseComponent","otherComponent","threeWayMerge","otherLabel","currentLabel","provider","cli","loggerMain","compWriter","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","RevertCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","RemoveAspect","MainRuntime","addRuntime","_default"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { ApplyVersionResults, FailedComponents } 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 getMergeStrategyInteractive,\n MergeStrategy,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Version, ModelComponent, Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ComponentNotFoundInPath from '@teambit/legacy/dist/consumer/component/exceptions/component-not-found-in-path';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\nimport { applyVersion, ComponentStatus, ComponentStatusBase, throwForFailures } from './checkout-version';\nimport { RevertCmd } from './revert-cmd';\n\nexport type CheckoutProps = {\n version?: string; // if reset/head/latest is true, the version is undefined\n ids?: ComponentID[];\n head?: boolean;\n latest?: boolean;\n main?: boolean; // relevant for \"revert\" only\n promptMergeOptions?: boolean;\n mergeStrategy?: MergeStrategy | null; // strategy to use in case of conflicts\n forceOurs?: boolean; // regardless of conflicts, use ours\n forceTheirs?: boolean; // regardless of conflicts, use theirs\n verbose?: boolean;\n skipNpmInstall?: boolean;\n reset?: boolean; // remove local changes. if set, the version is undefined.\n revert?: boolean; // change the files according to the given version, but don't change the bitmap version and don't try to merge\n all?: boolean; // checkout all ids\n isLane?: boolean;\n lane?: Lane; // currently needed for \"bit switch\" to tell the \"fetch\" where to fetch from\n workspaceOnly?: boolean;\n versionPerId?: ComponentID[]; // if given, the ComponentID.version is the version to checkout to.\n skipUpdatingBitmap?: boolean; // needed for stash\n restoreMissingComponents?: boolean; // in case .bitmap has a component and it's missing from the workspace, restore it (from model)\n allowAddingComponentsFromScope?: boolean; // in case the id doesn't exist in .bitmap, add it from the scope (relevant for switch)\n includeLocallyDeleted?: boolean; // include components that were deleted locally. currently enabled for \"bit checkout reset\" only.\n};\n\nexport type ComponentStatusBeforeMergeAttempt = ComponentStatusBase & {\n propsForMerge?: {\n currentlyUsedVersion: string;\n componentModel: ModelComponent;\n };\n};\n\nexport class CheckoutMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private remove: RemoveMain\n ) {}\n\n async checkout(checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const { version, ids, promptMergeOptions } = checkoutProps;\n await this.syncNewComponents(checkoutProps);\n const addedComponents = await this.restoreMissingComponents(checkoutProps);\n const bitIds = ComponentIdList.fromArray(ids?.map((id) => id) || []);\n // don't use Promise.all, it loads the components and this operation must be in sequence.\n const allComponentStatusBeforeMerge = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, checkoutProps)\n );\n const compsNeedMerge = allComponentStatusBeforeMerge.filter((c) => c.propsForMerge);\n const compsNotNeedMerge = allComponentStatusBeforeMerge.filter((c) => !c.propsForMerge) as ComponentStatus[];\n\n // in case the requested versions to checkout don't exist locally, import them.\n const toImport = allComponentStatusBeforeMerge\n .map((compStatus) => {\n const idsToImport = [compStatus.id];\n if (compStatus.propsForMerge) {\n idsToImport.push(compStatus.id.changeVersion(compStatus.propsForMerge.currentlyUsedVersion));\n }\n return idsToImport;\n })\n .flat();\n\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n cache: true,\n lane: checkoutProps.lane,\n });\n\n const getComponentsStatusOfMergeNeeded = async (): Promise<ComponentStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const afterMergeAttempt = await Promise.all(compsNeedMerge.map((c) => this.getMergeStatus(c)));\n await tmp.clear();\n return afterMergeAttempt;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n\n const compStatusMergeNeeded = await getComponentsStatusOfMergeNeeded();\n\n const allComponentsStatus: ComponentStatus[] = [...compStatusMergeNeeded, ...compsNotNeedMerge];\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!promptMergeOptions && !checkoutProps.mergeStrategy) {\n throw new BitError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--auto-merge-resolve\" with 'manual', 'ours' or 'theirs' to resolve the conflict/s`\n );\n }\n if (!checkoutProps.mergeStrategy) checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n\n throwForFailures(allComponentsStatus);\n\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const checkoutPropsLegacy = { ...checkoutProps, ids: checkoutProps.ids?.map((id) => id) };\n const componentsResults = await mapSeries(succeededComponents, ({ id, currentComponent, mergeResults }) => {\n return applyVersion(consumer, id, currentComponent, mergeResults, checkoutPropsLegacy);\n });\n\n const componentsLegacy = compact(componentsResults.map((c) => c.component));\n\n let newFromLane: ComponentID[] | undefined;\n let newFromLaneAdded = false;\n if (checkoutProps.head) {\n newFromLane = await this.getNewComponentsFromLane(checkoutProps.ids || []);\n if (!checkoutProps.workspaceOnly) {\n const compsNewFromLane = await Promise.all(\n newFromLane.map((id) => consumer.loadComponentFromModelImportIfNeeded(id))\n );\n componentsLegacy.push(...compsNewFromLane);\n newFromLaneAdded = true;\n }\n }\n\n const leftUnresolvedConflicts = componentWithConflict && checkoutProps.mergeStrategy === 'manual';\n let componentWriterResults;\n if (componentsLegacy.length) {\n const manyComponentsWriterOpts = {\n components: componentsLegacy,\n skipDependencyInstallation: checkoutProps.skipNpmInstall || leftUnresolvedConflicts,\n verbose: checkoutProps.verbose,\n resetConfig: checkoutProps.reset,\n skipUpdatingBitMap: checkoutProps.skipUpdatingBitmap || checkoutProps.revert,\n reasonForBitmapChange: 'checkout',\n };\n componentWriterResults = await this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n const componentIdsToRemove = allComponentsStatus\n .filter((componentStatus) => componentStatus.shouldBeRemoved)\n .map((c) => c.id.changeVersion(undefined));\n\n if (componentIdsToRemove.length) {\n await this.remove.removeLocallyByIds(componentIdsToRemove, { force: true, reasonForRemoval: 'checkout' });\n }\n\n return {\n components: appliedVersionComponents,\n removedComponents: componentIdsToRemove,\n addedComponents,\n 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 /**\n * if .bitmap entry exists but the rootDir is missing from the filesystem, find the component in the scope and restore it.\n * returns the restored component ids.\n */\n async restoreMissingComponents(checkoutProps: CheckoutProps): Promise<ComponentID[] | undefined> {\n if (checkoutProps.reset) {\n checkoutProps.restoreMissingComponents = true;\n }\n if (!checkoutProps.restoreMissingComponents) return undefined;\n const ids = checkoutProps.ids || [];\n const missing: ComponentID[] = [];\n await Promise.all(\n ids.map(async (id) => {\n const bitMapEntry = this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true });\n if (bitMapEntry.noFilesError && bitMapEntry.noFilesError instanceof ComponentNotFoundInPath) {\n delete bitMapEntry.noFilesError;\n missing.push(id);\n }\n })\n );\n if (!missing.length) return undefined;\n const comps = await this.workspace.scope.getMany(missing);\n await this.componentWriter.writeMany({\n components: comps.map((c) => c.state._consumer),\n skipDependencyInstallation: true,\n skipUpdatingBitMap: true,\n });\n\n return missing;\n }\n\n async checkoutByCLIValues(componentPattern: string, checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n const { revert, head } = checkoutProps;\n this.logger.setStatusLine(revert ? 'reverting components...' : BEFORE_CHECKOUT);\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n await this.importer.importCurrentObjects(); // important. among others, it fetches the remote lane object and its new components.\n if (head) await this.makeLaneComponentsAvailableOnMain();\n await this.parseValues(componentPattern, checkoutProps);\n const checkoutResults = await this.checkout(checkoutProps);\n await consumer.onDestroy(`checkout (${componentPattern})`);\n return checkoutResults;\n }\n\n private async syncNewComponents({ ids, head }: CheckoutProps) {\n if (!head) return;\n const notExported = ids?.filter((id) => !this.workspace.isExported(id)).map((id) => id.changeScope(id.scope));\n const scopeComponentsImporter = this.workspace.consumer.scope.scopeImporter;\n try {\n await scopeComponentsImporter.importWithoutDeps(ComponentIdList.fromArray(notExported || []).toVersionLatest(), {\n cache: false,\n reason: 'for making sure the new components are really new and are not out-of-sync',\n includeUnexported: true,\n });\n } catch (err) {\n // don't stop the process. it's possible that the scope doesn't exist yet because these are new components\n this.logger.error(`unable to sync new components, if these components are really new, ignore the error`, err);\n }\n }\n\n private async makeLaneComponentsAvailableOnMain() {\n const unavailableOnMain = await this.workspace.getUnavailableOnMainComponents();\n if (!unavailableOnMain.length) return;\n this.workspace.bitMap.makeComponentsAvailableOnMain(unavailableOnMain);\n }\n\n private async parseValues(componentPattern: string, checkoutProps: CheckoutProps) {\n if (checkoutProps.head && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (checkoutProps.latest && !componentPattern) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${LATEST}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (componentPattern && checkoutProps.all) {\n throw new BitError('please specify either [component-pattern] or --all, not both');\n }\n if (!componentPattern && !checkoutProps.all) {\n throw new BitError('please specify [component-pattern] or use --all flag');\n }\n if (checkoutProps.workspaceOnly && !checkoutProps.head) {\n throw new BitError(`--workspace-only flag can only be used with \"head\" (bit checkout head --workspace-only)`);\n }\n if (checkoutProps.reset || checkoutProps.head) {\n checkoutProps.includeLocallyDeleted = true;\n }\n\n const getIds = async () => {\n if (componentPattern) {\n return this.workspace.idsByPattern(componentPattern, true, {\n includeDeleted: checkoutProps.includeLocallyDeleted,\n });\n }\n return checkoutProps.includeLocallyDeleted ? this.workspace.listIdsIncludeRemoved() : this.workspace.listIds();\n };\n\n const idsOnWorkspace = await getIds();\n\n const currentLane = await this.workspace.consumer.getCurrentLaneObject();\n const currentLaneIds = currentLane?.toBitIds();\n const ids = currentLaneIds ? idsOnWorkspace.filter((id) => currentLaneIds.hasWithoutVersion(id)) : idsOnWorkspace;\n checkoutProps.ids = ids.map((id) => (checkoutProps.head || checkoutProps.latest ? id.changeVersion(LATEST) : id));\n }\n\n private async getNewComponentsFromLane(ids: ComponentID[]): Promise<ComponentID[]> {\n // current lane object is up to date due to the previous `importCurrentObjects()` call\n const lane = await this.workspace.consumer.getCurrentLaneObject();\n if (!lane) {\n return [];\n }\n const laneBitIds = lane.toBitIds();\n const newIds = laneBitIds.filter((bitId) => !ids.find((id) => id.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 // eslint-disable-next-line complexity\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID,\n checkoutProps: CheckoutProps\n ): Promise<ComponentStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const {\n version,\n head: headVersion,\n reset,\n revert,\n main,\n latest: latestVersion,\n versionPerId,\n forceOurs,\n forceTheirs,\n } = checkoutProps;\n const repo = consumer.scope.objects;\n\n let existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const getComponent = async () => {\n try {\n const results = await consumer.loadComponents(ComponentIdList.fromArray([id]));\n if (results.components[0]) return results.components[0];\n if (checkoutProps.includeLocallyDeleted && results.removedComponents[0]) {\n return results.removedComponents[0];\n }\n } catch (err) {\n if (checkoutProps.allowAddingComponentsFromScope && !existingBitMapId) return undefined;\n throw err;\n }\n return undefined;\n };\n const component = await getComponent();\n if (component) {\n // the component might fix an out-of-sync issue and as a result, the id has changed\n id = component.id;\n existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n }\n\n const componentModel = await consumer.scope.getModelComponentIfExist(id);\n const componentStatus: ComponentStatusBeforeMergeAttempt = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n if (!componentModel) {\n return returnFailure(`component ${id.toString()} is new, no version to checkout`, true);\n }\n if (main && !componentModel.head) {\n return returnFailure(`component ${id.toString()} is not available on main`);\n }\n const unmerged = repo.unmergedComponents.getEntry(id);\n if (!reset && unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n\n const getNewVersion = async (): Promise<string> => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (reset) return component!.id.version as string;\n if (headVersion) return componentModel.headIncludeRemote(repo);\n // we verified previously that head exists in case of \"main\"\n if (main) return componentModel.head?.toString() as string;\n if (latestVersion) {\n const latest = componentModel.latestVersionIfExist();\n return latest || componentModel.headIncludeRemote(repo);\n }\n if (versionPerId) {\n return versionPerId.find((bitId) => bitId.isEqualWithoutVersion(id))?.version as string;\n }\n\n // if all above are false, the version is defined\n return version as string;\n };\n const newVersion = await getNewVersion();\n if (version && !headVersion) {\n const hasVersion = await componentModel.hasVersion(version, repo);\n if (!hasVersion) return returnFailure(`component ${id.toStringWithoutVersion()} doesn't have version ${version}`);\n }\n const currentlyUsedVersion = existingBitMapId?.version;\n if (existingBitMapId && !currentlyUsedVersion) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is new`);\n }\n if (version && currentlyUsedVersion === version) {\n // it won't be relevant for 'reset' as it doesn't have a version\n return returnFailure(`component ${id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n if (headVersion && currentlyUsedVersion === newVersion) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is already at the latest version, which is ${newVersion}`,\n true\n );\n }\n if (!reset) {\n const divergeDataForMergePending = await componentModel.getDivergeDataForMergePending(repo);\n const isMergePending = divergeDataForMergePending.isDiverged();\n if (isMergePending) {\n return returnFailure(`component is merge-pending and cannot be checked out, run \"bit status\" for more info`);\n }\n }\n let isModified = false;\n if (currentlyUsedVersion) {\n const currentVersionObject: Version = await componentModel.loadVersion(currentlyUsedVersion, repo);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n isModified = await consumer.isComponentModified(currentVersionObject, component!);\n const isRemoved = component && component.isRemoved();\n if (!isModified && !isRemoved && reset) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not modified`, true);\n }\n }\n\n const versionRef = componentModel.getRef(newVersion);\n if (!versionRef) throw new Error(`unable to get ref ${newVersion} from ${componentModel.id()}`);\n const componentVersion = (await consumer.scope.getObject(versionRef.hash)) as Version | undefined;\n if (componentVersion?.isRemoved()) {\n if (existingBitMapId) componentStatus.shouldBeRemoved = true;\n return returnFailure(`component has been removed`, true);\n }\n\n const newId = id.changeVersion(newVersion);\n\n if (reset || !isModified || revert || !currentlyUsedVersion || forceTheirs || forceOurs) {\n // if the component is not modified, no need to try merge the files, they will be written later on according to the\n // checked out version. same thing when no version is specified, it'll be reset to the model-version later.\n\n // if !currentlyUsedVersion it only exists in the model, so just write it. (happening during bit-switch/bit-lane-import)\n return { currentComponent: component, componentFromModel: componentVersion, id: newId };\n }\n\n const propsForMerge = {\n currentlyUsedVersion,\n componentModel,\n };\n\n return { currentComponent: component, componentFromModel: componentVersion, id: newId, propsForMerge };\n }\n\n private async getMergeStatus({\n currentComponent: componentFromFS,\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 { currentComponent: componentFromFS, componentFromModel, id, mergeResults };\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, ComponentWriterAspect, ImporterAspect, RemoveAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain, compWriter, importer, remove]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger, compWriter, importer, remove);\n cli.register(new CheckoutCmd(checkoutMain), new RevertCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,eAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAS,sBAAA,CAAAR,OAAA;EAAAO,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAU,UAAA;EAAA,MAAAV,IAAA,GAAAS,sBAAA,CAAAR,OAAA;EAAA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,EAAEuI,eAAe;MAAED,kBAAkB;MAAEvL,EAAE;MAAEkC;IAAa,CAAC;EACpF;EAOA,aAAa6J,QAAQA,CAAC,CAACC,GAAG,EAAElN,SAAS,EAAEmN,UAAU,EAAEC,UAAU,EAAEjN,QAAQ,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMH,MAAM,GAAGkN,UAAU,CAACE,YAAY,CAACC,0BAAc,CAACpM,EAAE,CAAC;IACzD,MAAMqM,YAAY,GAAG,IAAIzN,YAAY,CAACE,SAAS,EAAEC,MAAM,EAAEmN,UAAU,EAAEjN,QAAQ,EAAEC,MAAM,CAAC;IACtF8M,GAAG,CAACM,QAAQ,CAAC,KAAIC,0BAAW,EAACF,YAAY,CAAC,EAAE,KAAIG,sBAAS,EAACH,YAAY,CAAC,CAAC;IACxE,OAAOA,YAAY;EACrB;AACF;AAACI,OAAA,CAAA7N,YAAA,GAAAA,YAAA;AAAAd,eAAA,CA3cYc,YAAY,WAybR,EAAE;AAAAd,eAAA,CAzbNc,YAAY,kBA0bD,CAAC8N,gBAAS,EAAEC,oBAAe,EAAEC,sBAAY,EAAEC,wCAAqB,EAAEC,mBAAc,EAAEC,iBAAY,CAAC;AAAAjP,eAAA,CA1b1Gc,YAAY,aA4bNoO,kBAAW;AAiB9BZ,0BAAc,CAACa,UAAU,CAACrO,YAAY,CAAC;AAAC,IAAAsO,QAAA,GAAAT,OAAA,CAAA3Q,OAAA,GAEzB8C,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/checkout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.152",
|
|
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.152"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"@teambit/bit-error": "0.0.404",
|
|
16
16
|
"@teambit/component-id": "1.2.0",
|
|
17
17
|
"@teambit/harmony": "0.4.6",
|
|
18
|
-
"@teambit/cli": "0.0.
|
|
19
|
-
"@teambit/merging": "1.0.
|
|
20
|
-
"@teambit/component-writer": "1.0.
|
|
21
|
-
"@teambit/importer": "1.0.
|
|
22
|
-
"@teambit/logger": "0.0.
|
|
23
|
-
"@teambit/remove": "1.0.
|
|
24
|
-
"@teambit/workspace": "1.0.
|
|
18
|
+
"@teambit/cli": "0.0.850",
|
|
19
|
+
"@teambit/merging": "1.0.152",
|
|
20
|
+
"@teambit/component-writer": "1.0.152",
|
|
21
|
+
"@teambit/importer": "1.0.152",
|
|
22
|
+
"@teambit/logger": "0.0.943",
|
|
23
|
+
"@teambit/remove": "1.0.152",
|
|
24
|
+
"@teambit/workspace": "1.0.152"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/lodash": "4.14.165",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"fs-extra": "10.0.0",
|
|
34
34
|
"@types/mocha": "9.1.0",
|
|
35
35
|
"@teambit/harmony.envs.core-aspect-env": "0.0.24",
|
|
36
|
-
"@teambit/component.testing.mock-components": "0.0.
|
|
37
|
-
"@teambit/harmony.testing.load-aspect": "0.0.
|
|
38
|
-
"@teambit/snapping": "1.0.
|
|
36
|
+
"@teambit/component.testing.mock-components": "0.0.187",
|
|
37
|
+
"@teambit/harmony.testing.load-aspect": "0.0.185",
|
|
38
|
+
"@teambit/snapping": "1.0.152",
|
|
39
39
|
"@teambit/workspace.testing.mock-workspace": "0.0.23"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
File without changes
|