@teambit/importer 0.0.422 → 0.0.424

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.
@@ -1,7 +1,7 @@
1
1
  import { LaneId } from '@teambit/lane-id';
2
2
  import { BitId, BitIds } from '@teambit/legacy/dist/bit-id';
3
3
  import { Consumer } from '@teambit/legacy/dist/consumer';
4
- import { ComponentWithDependencies, Scope } from '@teambit/legacy/dist/scope';
4
+ import { Scope } from '@teambit/legacy/dist/scope';
5
5
  import DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';
6
6
  import { Lane } from '@teambit/legacy/dist/scope/models';
7
7
  import Component from '@teambit/legacy/dist/consumer/component';
@@ -34,7 +34,7 @@ export declare type ImportOptions = {
34
34
  fetchDeps?: boolean;
35
35
  };
36
36
  declare type ComponentMergeStatus = {
37
- componentWithDependencies: ComponentWithDependencies;
37
+ component: Component;
38
38
  mergeResults: MergeResultsThreeWay | null | undefined;
39
39
  };
40
40
  declare type ImportedVersions = {
@@ -76,7 +76,7 @@ export default class ImportComponents {
76
76
  importComponents(): Promise<ImportResult>;
77
77
  importObjectsOnLane(): Promise<ImportResult>;
78
78
  importSpecificComponents(): Promise<ImportResult>;
79
- _fetchDivergeData(componentsWithDependencies: ComponentWithDependencies[]): Promise<void>;
79
+ _fetchDivergeData(components: Component[]): Promise<void>;
80
80
  _throwForDivergedHistory(): void;
81
81
  private _importComponentsObjects;
82
82
  /**
@@ -110,7 +110,7 @@ export default class ImportComponents {
110
110
  * hash and they'll override each other.
111
111
  */
112
112
  _throwForDifferentComponentWithSameName(ids: BitIds): void;
113
- _getMergeStatus(componentWithDependencies: ComponentWithDependencies): Promise<ComponentMergeStatus>;
113
+ _getMergeStatus(component: Component): Promise<ComponentMergeStatus>;
114
114
  /**
115
115
  * 1) when there are conflicts and the strategy is "ours", don't write the imported component to
116
116
  * the filesystem, only update bitmap.
@@ -126,9 +126,9 @@ export default class ImportComponents {
126
126
  * update the component files if they are modified and there is a merge strategy.
127
127
  * returns only the components that need to be written to the filesystem
128
128
  */
129
- updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies: ComponentWithDependencies[]): Promise<ComponentWithDependencies[]>;
129
+ updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]>;
130
130
  _shouldSaveLaneData(): boolean;
131
- _saveLaneDataIfNeeded(componentsWithDependencies: ComponentWithDependencies[]): Promise<void>;
132
- _writeToFileSystem(componentsWithDependencies: ComponentWithDependencies[]): Promise<ComponentWriterResults>;
131
+ _saveLaneDataIfNeeded(components: Component[]): Promise<void>;
132
+ _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults>;
133
133
  }
134
134
  export {};
@@ -192,20 +192,6 @@ class ImportComponents {
192
192
  lane
193
193
  });
194
194
 
195
- // import lane components from their original scope, this way, it's possible to run diff/merge on them.
196
- // don't use `scope.getDefaultLaneIdsFromLane()`. we need all components, because it's possible that a component
197
- // does't have "head" locally although it exits in the origin-scope. it happens when the component was created on
198
- // the origin-scope after a component with the same-name was created on the lane
199
- // if (lane) {
200
- // // @todo: optimize this maybe. currently, it imports twice.
201
- // // try to make the previous `importComponentsObjectsHarmony` import the same component once from the original
202
- // // scope and once from the lane-scope.
203
- // const mainIdsLatest = BitIds.fromArray(lane.toBitIds().map((m) => m.changeVersion(undefined)));
204
- // await this._importComponentsObjects(mainIdsLatest, {
205
- // ignoreMissingHead: true,
206
- // });
207
- // }
208
-
209
195
  // merge the lane objects
210
196
  const mergeAllLanesResults = await (0, _pMapSeries().default)(this.laneObjects, laneObject => this.scope.sources.mergeLane(laneObject, true));
211
197
  const mergedLanes = mergeAllLanesResults.map(result => result.mergeLane);
@@ -235,12 +221,12 @@ class ImportComponents {
235
221
  let writtenComponents = [];
236
222
  let componentWriterResults;
237
223
  if (!this.options.objectsOnly) {
238
- const componentsWithDependencies = await (0, _versionDependencies().multipleVersionDependenciesToConsumer)(versionDependenciesArr, this.scope.objects);
239
- await this._fetchDivergeData(componentsWithDependencies);
224
+ const components = await (0, _versionDependencies().multipleVersionDependenciesToConsumer)(versionDependenciesArr, this.scope.objects);
225
+ await this._fetchDivergeData(components);
240
226
  this._throwForDivergedHistory();
241
- componentWriterResults = await this._writeToFileSystem(componentsWithDependencies);
242
- await this._saveLaneDataIfNeeded(componentsWithDependencies);
243
- writtenComponents = componentsWithDependencies.map(c => c.component);
227
+ componentWriterResults = await this._writeToFileSystem(components);
228
+ await this._saveLaneDataIfNeeded(components);
229
+ writtenComponents = components;
244
230
  }
245
231
  const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);
246
232
  return {
@@ -252,15 +238,13 @@ class ImportComponents {
252
238
  compilationError: (_componentWriterResul2 = componentWriterResults) === null || _componentWriterResul2 === void 0 ? void 0 : _componentWriterResul2.compilationError
253
239
  };
254
240
  }
255
- async _fetchDivergeData(componentsWithDependencies) {
241
+ async _fetchDivergeData(components) {
256
242
  if (this.options.objectsOnly) {
257
243
  // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane
258
244
  // component is in bitmap using an older version, it throws "getDivergeData: unable to find Version X of Y"
259
245
  return;
260
246
  }
261
- await Promise.all(componentsWithDependencies.map(async ({
262
- component
263
- }) => {
247
+ await Promise.all(components.map(async component => {
264
248
  const modelComponent = await this.scope.getModelComponent(component.id);
265
249
  await modelComponent.setDivergeData(this.scope.objects, undefined, false);
266
250
  this.divergeData.push(modelComponent);
@@ -435,9 +419,9 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
435
419
  let writtenComponents = [];
436
420
  let componentWriterResults;
437
421
  if (!this.options.objectsOnly) {
438
- const componentWithDependencies = await (0, _versionDependencies().multipleVersionDependenciesToConsumer)(versionDependenciesArr, this.scope.objects);
439
- componentWriterResults = await this._writeToFileSystem(componentWithDependencies);
440
- writtenComponents = componentWithDependencies.map(c => c.component);
422
+ const components = await (0, _versionDependencies().multipleVersionDependenciesToConsumer)(versionDependenciesArr, this.scope.objects);
423
+ componentWriterResults = await this._writeToFileSystem(components);
424
+ writtenComponents = components;
441
425
  }
442
426
  const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);
443
427
  return {
@@ -534,11 +518,10 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
534
518
  }
535
519
  });
536
520
  }
537
- async _getMergeStatus(componentWithDependencies) {
538
- const component = componentWithDependencies.component;
521
+ async _getMergeStatus(component) {
539
522
  const componentStatus = await this.consumer.getComponentStatusById(component.id);
540
523
  const mergeStatus = {
541
- componentWithDependencies,
524
+ component,
542
525
  mergeResults: null
543
526
  };
544
527
  if (!componentStatus.modified) return mergeStatus;
@@ -578,7 +561,7 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
578
561
  _updateComponentFilesPerMergeStrategy(componentMergeStatus) {
579
562
  const mergeResults = componentMergeStatus.mergeResults;
580
563
  if (!mergeResults) return null;
581
- const component = componentMergeStatus.componentWithDependencies.component;
564
+ const component = componentMergeStatus.component;
582
565
  const files = component.files;
583
566
  if (mergeResults.hasConflicts && this.options.mergeStrategy === _mergeVersion().MergeOptions.ours) {
584
567
  const filesStatus = {};
@@ -612,10 +595,10 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
612
595
  * update the component files if they are modified and there is a merge strategy.
613
596
  * returns only the components that need to be written to the filesystem
614
597
  */
615
- async updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies) {
616
- if (!this.options.merge) return componentsWithDependencies;
617
- const componentsStatusP = componentsWithDependencies.map(componentWithDependencies => {
618
- return this._getMergeStatus(componentWithDependencies);
598
+ async updateAllComponentsAccordingToMergeStrategy(components) {
599
+ if (!this.options.merge) return components;
600
+ const componentsStatusP = components.map(component => {
601
+ return this._getMergeStatus(component);
619
602
  });
620
603
  const componentsStatus = await Promise.all(componentsStatusP);
621
604
  const componentWithConflict = componentsStatus.find(component => component.mergeResults && component.mergeResults.hasConflicts);
@@ -625,15 +608,15 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
625
608
  this.mergeStatus = {};
626
609
  const componentsToWrite = componentsStatus.map(componentStatus => {
627
610
  const filesStatus = this._updateComponentFilesPerMergeStrategy(componentStatus);
628
- const componentWithDependencies = componentStatus.componentWithDependencies;
629
- if (!filesStatus) return componentWithDependencies;
630
- this.mergeStatus[componentWithDependencies.component.id.toStringWithoutVersion()] = filesStatus;
611
+ const component = componentStatus.component;
612
+ if (!filesStatus) return component;
613
+ this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;
631
614
  const unchangedFiles = Object.keys(filesStatus).filter(file => filesStatus[file] === _mergeVersion().FileStatus.unchanged);
632
615
  if (unchangedFiles.length === Object.keys(filesStatus).length) {
633
616
  // all files are unchanged
634
617
  return null;
635
618
  }
636
- return componentWithDependencies;
619
+ return component;
637
620
  });
638
621
  const removeNulls = _ramda().default.reject(_ramda().default.isNil);
639
622
  return removeNulls(componentsToWrite);
@@ -644,7 +627,7 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
644
627
  }
645
628
  return this.consumer.isOnLane();
646
629
  }
647
- async _saveLaneDataIfNeeded(componentsWithDependencies) {
630
+ async _saveLaneDataIfNeeded(components) {
648
631
  if (!this._shouldSaveLaneData()) {
649
632
  return;
650
633
  }
@@ -654,7 +637,6 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
654
637
  }
655
638
 
656
639
  const idsFromRemoteLanes = _bitId().BitIds.fromArray(this.laneObjects.flatMap(lane => lane.toBitIds()));
657
- const components = componentsWithDependencies.map(c => c.component);
658
640
  await Promise.all(components.map(async comp => {
659
641
  const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);
660
642
  if (!existOnRemoteLane && !this.options.saveInLane) {
@@ -671,11 +653,11 @@ bit import ${idsFromRemote.map(id => id.toStringWithoutVersion()).join(' ')}`);
671
653
  }));
672
654
  await this.scope.lanes.saveLane(currentLane);
673
655
  }
674
- async _writeToFileSystem(componentsWithDependencies) {
675
- const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies);
656
+ async _writeToFileSystem(components) {
657
+ const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);
676
658
  const manyComponentsWriterOpts = {
677
659
  consumer: this.consumer,
678
- componentsWithDependencies: componentsToWrite,
660
+ components: componentsToWrite,
679
661
  writeToPath: this.options.writeToPath,
680
662
  writeConfig: this.options.writeConfig,
681
663
  skipDependencyInstallation: !this.options.installNpmPackages,
@@ -1 +1 @@
1
- {"version":3,"names":["ImportComponents","constructor","workspace","graph","componentWriter","options","consumer","scope","laneObjects","lanes","importComponents","loader","start","BEFORE_IMPORT_ACTION","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","map","result","Promise","all","mergedLane","saveLane","importDetails","_getImportDetails","importedIds","v","component","flat","importedDeps","allDependenciesIds","join","_throwForPotentialIssues","writtenComponents","componentWriterResults","componentsWithDependencies","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","_writeToFileSystem","_saveLaneDataIfNeeded","c","installationError","compilationError","modelComponent","getModelComponent","setDivergeData","divergeData","push","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","allHistory","collectParents","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","getBitIdsForLanes","bitIdsFromLane","BitIds","fromArray","flatMap","toBitIds","mainIds","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","mainIdsToImport","hasScope","hasWithoutVersion","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","BitError","l","name","toStringWithoutVersion","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraphIds","targetCompIds","resolveMultipleComponentIds","sourceIds","listIds","findIdsFromSourcesToTargets","_legacy","uniqFromArray","dependencies","bitId","componentGraph","find","scopeName","dependenciesInfo","getDependenciesInfo","d","R","flatten","_getDependentsFromGraph","dependents","dependentsInfo","getDependentsInfo","remotes","getScopeRemotes","scopeGraphs","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","isEmpty","_throwForModifiedOrNewComponents","componentWithDependencies","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","changeVersion","listVersions","versions","fromPairs","currentVersions","components","detailsP","Object","keys","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","includes","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","GeneralError","chalk","yellow","forEach","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","currentLane","getCurrentLaneObject","idsFromRemoteLanes","comp","existOnRemoteLane","has","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","verbose","throwForExistingDir","writeMany"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { ComponentWithDependencies, Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { FilesStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults } from '@teambit/component-writer';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n objectsOnly?: boolean;\n saveDependenciesAsComponents?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages or nested, not as imported\n importDependents?: boolean;\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneIds: LaneId[];\n lanes: Lane[]; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n};\ntype ComponentMergeStatus = {\n componentWithDependencies: ComponentWithDependencies;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private laneObjects: Lane[];\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n importComponents(): Promise<ImportResult> {\n loader.start(BEFORE_IMPORT_ACTION);\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n return this.importObjectsOnLane();\n }\n if (this.options.ids.length) {\n return this.importSpecificComponents();\n }\n return this.importAccordingToBitMap();\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n // import lane components from their original scope, this way, it's possible to run diff/merge on them.\n // don't use `scope.getDefaultLaneIdsFromLane()`. we need all components, because it's possible that a component\n // does't have \"head\" locally although it exits in the origin-scope. it happens when the component was created on\n // the origin-scope after a component with the same-name was created on the lane\n // if (lane) {\n // // @todo: optimize this maybe. currently, it imports twice.\n // // try to make the previous `importComponentsObjectsHarmony` import the same component once from the original\n // // scope and once from the lane-scope.\n // const mainIdsLatest = BitIds.fromArray(lane.toBitIds().map((m) => m.changeVersion(undefined)));\n // await this._importComponentsObjects(mainIdsLatest, {\n // ignoreMissingHead: true,\n // });\n // }\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n importDetails,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const componentsWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n await this._fetchDivergeData(componentsWithDependencies);\n this._throwForDivergedHistory();\n componentWriterResults = await this._writeToFileSystem(componentsWithDependencies);\n await this._saveLaneDataIfNeeded(componentsWithDependencies);\n writtenComponents = componentsWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async _fetchDivergeData(componentsWithDependencies: ComponentWithDependencies[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n componentsWithDependencies.map(async ({ component }) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids,\n fromHead: this.options.allHistory,\n collectParents: this.options.allHistory,\n lane,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n });\n loader.start(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lanes: lane ? [lane] : undefined,\n preferDependencyGraph: !this.options.fetchDeps,\n reFetchUnBuiltVersion: true, // when user is running \"bit import\", we want to re-fetch if it wasn't built. todo: check if this can be disabled when not needed\n });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const mainIds = this.consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n const mainIdsToImport = mainIds.filter((id) => id.hasScope() && !bitIdsFromLane.hasWithoutVersion(id));\n bitIdsFromLane.push(...mainIdsToImport);\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane || id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraphIds();\n const targetCompIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const sourceIds = await this.workspace.listIds();\n const ids = graph.findIdsFromSourcesToTargets(sourceIds, targetCompIds);\n logger.debug(\n `found ${ids.length} component for --dependents flag`,\n ids.map((id) => id.toString())\n );\n bitIds.push(...ids.map((id) => id._legacy));\n }\n }\n return BitIds.uniqFromArray(bitIds);\n }\n\n _getDependenciesFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependencies = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependenciesInfo = componentGraph.getDependenciesInfo(bitId);\n return dependenciesInfo.map((d) => d.id);\n });\n return R.flatten(dependencies);\n }\n\n _getDependentsFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependents = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependentsInfo = componentGraph.getDependentsInfo(bitId);\n return dependentsInfo.map((d) => d.id);\n });\n return R.flatten(dependents);\n }\n\n async _getComponentsGraphs(bitIds: BitId[]): Promise<DependencyGraph[]> {\n const remotes: Remotes = await getScopeRemotes(this.consumer.scope);\n return remotes.scopeGraphs(bitIds, this.consumer.scope);\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (R.isEmpty(componentsIdsToImport)) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n throw new Error(`bit import with no ids and --merge flag was not implemented yet`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const componentWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n componentWriterResults = await this._writeToFileSystem(componentWithDependencies);\n writtenComponents = componentWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return BitIds.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: BitIds): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return R.fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new ShowDoctorError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = R.difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = await modelComponent.isDeprecated(this.scope.objects);\n const removed = await component.component.component.isRemoved(this.scope.objects);\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n return Promise.all(detailsP);\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(componentWithDependencies: ComponentWithDependencies): Promise<ComponentMergeStatus> {\n const component = componentWithDependencies.component;\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { componentWithDependencies, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.componentWithDependencies.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(\n componentsWithDependencies: ComponentWithDependencies[]\n ): Promise<ComponentWithDependencies[]> {\n if (!this.options.merge) return componentsWithDependencies;\n const componentsStatusP = componentsWithDependencies.map((componentWithDependencies: ComponentWithDependencies) => {\n return this._getMergeStatus(componentWithDependencies);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const componentWithDependencies = componentStatus.componentWithDependencies;\n if (!filesStatus) return componentWithDependencies;\n this.mergeStatus[componentWithDependencies.component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return componentWithDependencies;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(componentsWithDependencies: ComponentWithDependencies[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n const components = componentsWithDependencies.map((c) => c.component);\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(componentsWithDependencies: ComponentWithDependencies[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies);\n const manyComponentsWriterOpts = {\n consumer: this.consumer,\n componentsWithDependencies: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;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,EAAG,EAAC,CAAC;MAC9FmO,WAAW,CAACU,YAAY,CAAC;QAAE9O,EAAE,EAAEuO,IAAI,CAACvO,EAAE;QAAE+O,IAAI,EAAEH;MAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CACH;IACD,MAAM,IAAI,CAACnQ,KAAK,CAACE,KAAK,CAACsC,QAAQ,CAACmN,WAAW,CAAC;EAC9C;EAEA,MAAMjM,kBAAkB,CAACL,0BAAuD,EAAmC;IACjH,MAAM+L,iBAAiB,GAAG,MAAM,IAAI,CAACL,2CAA2C,CAAC1L,0BAA0B,CAAC;IAC5G,MAAMkN,wBAAwB,GAAG;MAC/BxQ,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBsD,0BAA0B,EAAE+L,iBAAiB;MAC7CoB,WAAW,EAAE,IAAI,CAAC1Q,OAAO,CAAC0Q,WAAW;MACrCC,WAAW,EAAE,IAAI,CAAC3Q,OAAO,CAAC2Q,WAAW;MACrCC,0BAA0B,EAAE,CAAC,IAAI,CAAC5Q,OAAO,CAAC6Q,kBAAkB;MAC5DC,OAAO,EAAE,IAAI,CAAC9Q,OAAO,CAAC8Q,OAAO;MAC7BC,mBAAmB,EAAE,CAAC,IAAI,CAAC/Q,OAAO,CAAC2J;IACrC,CAAC;IACD,OAAO,IAAI,CAAC5J,eAAe,CAACiR,SAAS,CAACP,wBAAwB,CAAC;EACjE;AACF;AAAC"}
1
+ {"version":3,"names":["ImportComponents","constructor","workspace","graph","componentWriter","options","consumer","scope","laneObjects","lanes","importComponents","loader","start","BEFORE_IMPORT_ACTION","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","map","result","Promise","all","mergedLane","saveLane","importDetails","_getImportDetails","importedIds","v","component","flat","importedDeps","allDependenciesIds","join","_throwForPotentialIssues","writtenComponents","componentWriterResults","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","_writeToFileSystem","_saveLaneDataIfNeeded","installationError","compilationError","modelComponent","getModelComponent","setDivergeData","divergeData","push","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","allHistory","collectParents","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","getBitIdsForLanes","bitIdsFromLane","BitIds","fromArray","flatMap","toBitIds","mainIds","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","mainIdsToImport","hasScope","hasWithoutVersion","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","BitError","l","name","toStringWithoutVersion","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraphIds","targetCompIds","resolveMultipleComponentIds","sourceIds","listIds","findIdsFromSourcesToTargets","_legacy","uniqFromArray","dependencies","bitId","componentGraph","find","scopeName","dependenciesInfo","getDependenciesInfo","d","R","flatten","_getDependentsFromGraph","dependents","dependentsInfo","getDependentsInfo","remotes","getScopeRemotes","scopeGraphs","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","isEmpty","_throwForModifiedOrNewComponents","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","changeVersion","listVersions","versions","fromPairs","currentVersions","detailsP","Object","keys","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","includes","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","c","GeneralError","chalk","yellow","forEach","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","currentLane","getCurrentLaneObject","idsFromRemoteLanes","comp","existOnRemoteLane","has","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","verbose","throwForExistingDir","writeMany"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { FilesStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults } from '@teambit/component-writer';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n objectsOnly?: boolean;\n saveDependenciesAsComponents?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages or nested, not as imported\n importDependents?: boolean;\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneIds: LaneId[];\n lanes: Lane[]; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n};\ntype ComponentMergeStatus = {\n component: Component;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private laneObjects: Lane[];\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n importComponents(): Promise<ImportResult> {\n loader.start(BEFORE_IMPORT_ACTION);\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n return this.importObjectsOnLane();\n }\n if (this.options.ids.length) {\n return this.importSpecificComponents();\n }\n return this.importAccordingToBitMap();\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n importDetails,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n componentWriterResults = await this._writeToFileSystem(components);\n await this._saveLaneDataIfNeeded(components);\n writtenComponents = components;\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n async _fetchDivergeData(components: Component[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n components.map(async (component) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids,\n fromHead: this.options.allHistory,\n collectParents: this.options.allHistory,\n lane,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n });\n loader.start(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lanes: lane ? [lane] : undefined,\n preferDependencyGraph: !this.options.fetchDeps,\n reFetchUnBuiltVersion: true, // when user is running \"bit import\", we want to re-fetch if it wasn't built. todo: check if this can be disabled when not needed\n });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const mainIds = this.consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n const mainIdsToImport = mainIds.filter((id) => id.hasScope() && !bitIdsFromLane.hasWithoutVersion(id));\n bitIdsFromLane.push(...mainIdsToImport);\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane || id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraphIds();\n const targetCompIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const sourceIds = await this.workspace.listIds();\n const ids = graph.findIdsFromSourcesToTargets(sourceIds, targetCompIds);\n logger.debug(\n `found ${ids.length} component for --dependents flag`,\n ids.map((id) => id.toString())\n );\n bitIds.push(...ids.map((id) => id._legacy));\n }\n }\n return BitIds.uniqFromArray(bitIds);\n }\n\n _getDependenciesFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependencies = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependenciesInfo = componentGraph.getDependenciesInfo(bitId);\n return dependenciesInfo.map((d) => d.id);\n });\n return R.flatten(dependencies);\n }\n\n _getDependentsFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependents = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependentsInfo = componentGraph.getDependentsInfo(bitId);\n return dependentsInfo.map((d) => d.id);\n });\n return R.flatten(dependents);\n }\n\n async _getComponentsGraphs(bitIds: BitId[]): Promise<DependencyGraph[]> {\n const remotes: Remotes = await getScopeRemotes(this.consumer.scope);\n return remotes.scopeGraphs(bitIds, this.consumer.scope);\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (R.isEmpty(componentsIdsToImport)) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n throw new Error(`bit import with no ids and --merge flag was not implemented yet`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n componentWriterResults = await this._writeToFileSystem(components);\n writtenComponents = components;\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n };\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return BitIds.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: BitIds): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return R.fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new ShowDoctorError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = R.difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = await modelComponent.isDeprecated(this.scope.objects);\n const removed = await component.component.component.isRemoved(this.scope.objects);\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n return Promise.all(detailsP);\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { component, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]> {\n if (!this.options.merge) return components;\n const componentsStatusP = components.map((component: Component) => {\n return this._getMergeStatus(component);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const component = componentStatus.component;\n if (!filesStatus) return component;\n this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return component;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(components: Component[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts = {\n consumer: this.consumer,\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAuDe,MAAMA,gBAAgB,CAAC;EAMpCC,WAAW,CACDC,SAAoB,E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,CAAC,IAAI,CAAC7Q,OAAO,CAAC0J;IACrC,CAAC;IACD,OAAO,IAAI,CAAC3J,eAAe,CAAC+Q,SAAS,CAACP,wBAAwB,CAAC;EACjE;AACF;AAAC"}
@@ -20,7 +20,15 @@ export declare class ImporterMain {
20
20
  private logger;
21
21
  constructor(workspace: Workspace, depResolver: DependencyResolverMain, graph: GraphMain, scope: ScopeMain, componentWriter: ComponentWriterMain, logger: Logger);
22
22
  import(importOptions: ImportOptions, packageManagerArgs: string[]): Promise<ImportResult>;
23
+ /**
24
+ * fetch objects according to the criteria set by `options` param.
25
+ * to fetch current objects according to the current lane or main, use `this.importCurrentObjects()`.
26
+ */
23
27
  importObjects(options?: Partial<ImportOptions>): Promise<ImportResult>;
28
+ /**
29
+ * if on main, fetch main objects, if on lane, fetch lane objects.
30
+ */
31
+ importCurrentObjects(): Promise<ImportResult>;
24
32
  importObjectsFromMainIfExist(ids: BitId[]): Promise<void>;
25
33
  fetchLaneWithComponents(lane: Lane, options?: Partial<ImportOptions>): Promise<ImportResult>;
26
34
  fetch(ids: string[], lanes: boolean, components: boolean, fromOriginalScope: boolean, allHistory?: boolean): Promise<ImportResult | {
@@ -229,6 +229,11 @@ class ImporterMain {
229
229
  await consumer.onDestroy();
230
230
  return results;
231
231
  }
232
+
233
+ /**
234
+ * fetch objects according to the criteria set by `options` param.
235
+ * to fetch current objects according to the current lane or main, use `this.importCurrentObjects()`.
236
+ */
232
237
  async importObjects(options = {}) {
233
238
  const importOptions = _objectSpread(_objectSpread({}, options), {}, {
234
239
  objectsOnly: true,
@@ -238,6 +243,27 @@ class ImporterMain {
238
243
  const importComponents = new (_importComponents().default)(this.workspace, this.graph, this.componentWriter, importOptions);
239
244
  return importComponents.importComponents();
240
245
  }
246
+
247
+ /**
248
+ * if on main, fetch main objects, if on lane, fetch lane objects.
249
+ */
250
+ async importCurrentObjects() {
251
+ if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
252
+ const importOptions = {
253
+ ids: [],
254
+ objectsOnly: true,
255
+ installNpmPackages: false
256
+ };
257
+ const currentRemoteLane = await this.workspace.getCurrentRemoteLane();
258
+ if (currentRemoteLane) {
259
+ importOptions.lanes = {
260
+ laneIds: [currentRemoteLane.toLaneId()],
261
+ lanes: [currentRemoteLane]
262
+ };
263
+ }
264
+ const importComponents = new (_importComponents().default)(this.workspace, this.graph, this.componentWriter, importOptions);
265
+ return importComponents.importComponents();
266
+ }
241
267
  async importObjectsFromMainIfExist(ids) {
242
268
  await this.scope.legacyScope.scopeImporter.importWithoutDeps(_bitId().BitIds.fromArray(ids), {
243
269
  cache: false,
@@ -314,10 +340,6 @@ class ImporterMain {
314
340
  }
315
341
  }
316
342
  async fetchLanes(lanes, shouldFetchFromMain, options = {}) {
317
- // workaround for an issue where we have the current-lane object at hand but not its components, the sources.get
318
- // throws an error about missing the Version object in the filesystem. to reproduce, comment the following line and
319
- // run the e2e-test "import objects for multiple lanes".
320
- await this.importObjects();
321
343
  const resultFromMain = shouldFetchFromMain ? await this.importObjects(options) : {
322
344
  importedIds: [],
323
345
  importDetails: [],
@@ -372,11 +394,11 @@ class ImporterMain {
372
394
  install.registerPreInstall(async opts => {
373
395
  if (!(opts !== null && opts !== void 0 && opts.import)) return;
374
396
  logger.setStatusLine('importing missing objects');
375
- await importerMain.importObjects();
397
+ await importerMain.importCurrentObjects();
376
398
  logger.consoleSuccess();
377
399
  });
378
400
  install.registerPreLink(async opts => {
379
- if (opts !== null && opts !== void 0 && opts.fetchObject) await importerMain.importObjects();
401
+ if (opts !== null && opts !== void 0 && opts.fetchObject) await importerMain.importCurrentObjects();
380
402
  });
381
403
  cli.register(new (_import().ImportCmd)(importerMain, community.getDocsDomain()), new (_fetchCmd().FetchCmd)(importerMain));
382
404
  return importerMain;
@@ -1 +1 @@
1
- {"version":3,"names":["ImporterMain","constructor","workspace","depResolver","graph","scope","componentWriter","logger","import","importOptions","packageManagerArgs","OutsideWorkspaceError","consumer","ids","length","objectsOnly","isOnLane","currentRemoteLane","getCurrentRemoteLane","lanes","laneIds","toLaneId","currentLaneId","getCurrentLaneId","importComponents","ImportComponents","results","Analytics","setExtraData","importedIds","writtenComponents","removeFromWorkspaceConfig","onDestroy","importObjects","options","installNpmPackages","importObjectsFromMainIfExist","legacyScope","scopeImporter","importWithoutDeps","BitIds","fromArray","cache","includeVersionHistory","ignoreMissingHead","fetchLaneWithComponents","lane","fetch","components","fromOriginalScope","allHistory","BitError","loader","start","lanesToFetch","getLanes","shouldFetchFromMain","includes","DEFAULT_LANE","fetchLanes","verbose","writeConfig","override","importDetails","remoteLaneIds","filter","id","map","trackLane","getRemoteTrackedDataByLocalLane","LaneId","from","remoteLane","remoteScope","parse","objects","remoteLanes","getAllRemoteLaneIds","scopeComponentImporter","ScopeComponentsImporter","getInstance","importLanes","err","InvalidScopeName","ScopeNotFoundOrDenied","LaneNotFound","InvalidScopeNameFromRemote","stop","console","message","resultFromMain","importedDeps","resultsPerLane","pMapSeries","setStatusLine","name","consoleSuccess","push","reduce","acc","curr","importLaneObject","laneId","persistIfNotExists","laneObject","exists","loadLane","saveLane","component","importedPackageNames","getImportedPackagesNames","removeFromRootPolicy","persistConfig","path","componentIdToPackageName","provider","cli","community","install","loggerMain","createLogger","ImporterAspect","importerMain","registerPreInstall","opts","registerPreLink","fetchObject","register","ImportCmd","getDocsDomain","FetchCmd","CLIAspect","WorkspaceAspect","DependencyResolverAspect","CommunityAspect","GraphAspect","ScopeAspect","ComponentWriterAspect","InstallAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["importer.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { BitId, InvalidScopeName, InvalidScopeNameFromRemote } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport ComponentWriterAspect, { ComponentWriterMain } from '@teambit/component-writer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport InstallAspect, { InstallMain } from '@teambit/install';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { ScopeNotFoundOrDenied } from '@teambit/legacy/dist/remotes/exceptions/scope-not-found-or-denied';\nimport GraphAspect, { GraphMain } from '@teambit/graph';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportCmd } from './import.cmd';\nimport { ImporterAspect } from './importer.aspect';\nimport { FetchCmd } from './fetch-cmd';\nimport ImportComponents, { ImportOptions, ImportResult } from './import-components';\n\nexport class ImporterMain {\n constructor(\n private workspace: Workspace,\n private depResolver: DependencyResolverMain,\n private graph: GraphMain,\n private scope: ScopeMain,\n private componentWriter: ComponentWriterMain,\n private logger: Logger\n ) {}\n\n async import(importOptions: ImportOptions, packageManagerArgs: string[]): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n consumer.packageManagerArgs = packageManagerArgs;\n if (!importOptions.ids.length) {\n importOptions.objectsOnly = true;\n }\n if (this.workspace.consumer.isOnLane()) {\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneIds: [currentRemoteLane.toLaneId()], lanes: [currentRemoteLane] };\n } else if (!importOptions.ids.length) {\n // this is probably a local lane that was never exported.\n // although no need to fetch from the lane, still, the import is needed for main (which are available on this\n // local lane)\n const currentLaneId = this.workspace.getCurrentLaneId();\n importOptions.lanes = { laneIds: [currentLaneId], lanes: [] };\n }\n }\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n const results = await importComponents.importComponents();\n Analytics.setExtraData('num_components', results.importedIds.length);\n if (results.writtenComponents && results.writtenComponents.length) {\n await this.removeFromWorkspaceConfig(results.writtenComponents);\n }\n await consumer.onDestroy();\n return results;\n }\n\n async importObjects(options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n const importOptions: ImportOptions = {\n ...options,\n objectsOnly: true,\n ids: options.ids || [],\n installNpmPackages: false,\n };\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n return importComponents.importComponents();\n }\n\n async importObjectsFromMainIfExist(ids: BitId[]) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(BitIds.fromArray(ids), {\n cache: false,\n includeVersionHistory: true,\n ignoreMissingHead: true,\n });\n }\n\n async fetchLaneWithComponents(lane: Lane, options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n options.lanes = { laneIds: [lane.toLaneId()], lanes: [lane] };\n return this.importObjects(options);\n }\n\n async fetch(ids: string[], lanes: boolean, components: boolean, fromOriginalScope: boolean, allHistory = false) {\n if (!lanes && !components) {\n throw new BitError(\n `please provide the type of objects you would like to pull, the options are --components and --lanes`\n );\n }\n loader.start('fetching objects...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n\n if (lanes) {\n const lanesToFetch = await getLanes(this.logger);\n const shouldFetchFromMain = !ids.length || ids.includes(DEFAULT_LANE);\n return this.fetchLanes(lanesToFetch, shouldFetchFromMain, { allHistory });\n }\n\n const importOptions: ImportOptions = {\n ids,\n objectsOnly: true,\n allHistory,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n fromOriginalScope,\n };\n\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n const { importedIds, importDetails } = await importComponents.importComponents();\n Analytics.setExtraData('num_components', importedIds.length);\n await consumer.onDestroy();\n return { importedIds, importDetails };\n\n async function getLanes(logger: Logger): Promise<Lane[]> {\n let remoteLaneIds: LaneId[] = [];\n if (ids.length) {\n remoteLaneIds = ids\n .filter((id) => id !== DEFAULT_LANE)\n .map((id) => {\n const trackLane = consumer.scope.lanes.getRemoteTrackedDataByLocalLane(id);\n if (trackLane) return LaneId.from(trackLane.remoteLane, trackLane.remoteScope);\n return LaneId.parse(id);\n });\n } else {\n remoteLaneIds = await consumer.scope.objects.remoteLanes.getAllRemoteLaneIds();\n }\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(consumer.scope);\n try {\n return await scopeComponentImporter.importLanes(remoteLaneIds);\n } catch (err) {\n if (\n err instanceof InvalidScopeName ||\n err instanceof ScopeNotFoundOrDenied ||\n err instanceof LaneNotFound ||\n err instanceof InvalidScopeNameFromRemote\n ) {\n // the lane could be a local lane so no need to throw an error in such case\n loader.stop();\n logger.console(`unable to get lane's data from a remote due to an error:\\n${err.message}`, 'warn', 'yellow');\n } else {\n throw err;\n }\n }\n\n return [];\n }\n }\n\n async fetchLanes(\n lanes: Lane[],\n shouldFetchFromMain?: boolean,\n options: Partial<ImportOptions> = {}\n ): Promise<ImportResult> {\n // workaround for an issue where we have the current-lane object at hand but not its components, the sources.get\n // throws an error about missing the Version object in the filesystem. to reproduce, comment the following line and\n // run the e2e-test \"import objects for multiple lanes\".\n await this.importObjects();\n\n const resultFromMain = shouldFetchFromMain\n ? await this.importObjects(options)\n : { importedIds: [], importDetails: [], importedDeps: [] };\n const resultsPerLane = await pMapSeries(lanes, async (lane) => {\n this.logger.setStatusLine(`fetching lane ${lane.name}`);\n const results = await this.fetchLaneWithComponents(lane, options);\n this.logger.consoleSuccess();\n return results;\n });\n resultsPerLane.push(resultFromMain);\n const results = resultsPerLane.reduce((acc, curr) => {\n acc.importedIds.push(...curr.importedIds);\n acc.importDetails.push(...curr.importDetails);\n return acc;\n });\n return results;\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const results = await legacyScope.scopeImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n private async removeFromWorkspaceConfig(component: ConsumerComponent[]) {\n const importedPackageNames = this.getImportedPackagesNames(component);\n this.depResolver.removeFromRootPolicy(importedPackageNames);\n await this.depResolver.persistConfig(this.workspace.path);\n }\n\n private getImportedPackagesNames(components: ConsumerComponent[]): string[] {\n return components.map((component) => componentIdToPackageName(component));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n CommunityAspect,\n GraphAspect,\n ScopeAspect,\n ComponentWriterAspect,\n InstallAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, depResolver, community, graph, scope, componentWriter, install, loggerMain]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n CommunityMain,\n GraphMain,\n ScopeMain,\n ComponentWriterMain,\n InstallMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(ImporterAspect.id);\n const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, logger);\n install.registerPreInstall(async (opts) => {\n if (!opts?.import) return;\n logger.setStatusLine('importing missing objects');\n await importerMain.importObjects();\n logger.consoleSuccess();\n });\n install.registerPreLink(async (opts) => {\n if (opts?.fetchObject) await importerMain.importObjects();\n });\n cli.register(new ImportCmd(importerMain, community.getDocsDomain()), new FetchCmd(importerMain));\n return importerMain;\n }\n}\n\nImporterAspect.addRuntime(ImporterMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAoF;AAAA;AAAA;AAAA;AAE7E,MAAMA,YAAY,CAAC;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wD,YAAY,GAAG,IAAI1H,YAAY,CAACE,SAAS,EAAEC,WAAW,EAAEC,KAAK,EAAEC,KAAK,EAAEC,eAAe,EAAEC,MAAM,CAAC;IACpG+G,OAAO,CAACK,kBAAkB,CAAC,MAAOC,IAAI,IAAK;MACzC,IAAI,EAACA,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEpH,MAAM,GAAE;MACnBD,MAAM,CAACuF,aAAa,CAAC,2BAA2B,CAAC;MACjD,MAAM4B,YAAY,CAACzF,aAAa,EAAE;MAClC1B,MAAM,CAACyF,cAAc,EAAE;IACzB,CAAC,CAAC;IACFsB,OAAO,CAACO,eAAe,CAAC,MAAOD,IAAI,IAAK;MACtC,IAAIA,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEE,WAAW,EAAE,MAAMJ,YAAY,CAACzF,aAAa,EAAE;IAC3D,CAAC,CAAC;IACFmF,GAAG,CAACW,QAAQ,CAAC,KAAIC,mBAAS,EAACN,YAAY,EAAEL,SAAS,CAACY,aAAa,EAAE,CAAC,EAAE,KAAIC,oBAAQ,EAACR,YAAY,CAAC,CAAC;IAChG,OAAOA,YAAY;EACrB;AACF;AAAC;AAAA,gCAtOY1H,YAAY,WAgMR,EAAE;AAAA,gCAhMNA,YAAY,kBAiMD,CACpBmI,gBAAS,EACTC,oBAAe,EACfC,8CAAwB,EACxBC,4BAAe,EACfC,gBAAW,EACXC,gBAAW,EACXC,0BAAqB,EACrBC,kBAAa,EACbC,sBAAY,CACb;AAAA,gCA3MU3I,YAAY,aA4MN4I,kBAAW;AA4B9BnB,0BAAc,CAACoB,UAAU,CAAC7I,YAAY,CAAC"}
1
+ {"version":3,"names":["ImporterMain","constructor","workspace","depResolver","graph","scope","componentWriter","logger","import","importOptions","packageManagerArgs","OutsideWorkspaceError","consumer","ids","length","objectsOnly","isOnLane","currentRemoteLane","getCurrentRemoteLane","lanes","laneIds","toLaneId","currentLaneId","getCurrentLaneId","importComponents","ImportComponents","results","Analytics","setExtraData","importedIds","writtenComponents","removeFromWorkspaceConfig","onDestroy","importObjects","options","installNpmPackages","importCurrentObjects","importObjectsFromMainIfExist","legacyScope","scopeImporter","importWithoutDeps","BitIds","fromArray","cache","includeVersionHistory","ignoreMissingHead","fetchLaneWithComponents","lane","fetch","components","fromOriginalScope","allHistory","BitError","loader","start","lanesToFetch","getLanes","shouldFetchFromMain","includes","DEFAULT_LANE","fetchLanes","verbose","writeConfig","override","importDetails","remoteLaneIds","filter","id","map","trackLane","getRemoteTrackedDataByLocalLane","LaneId","from","remoteLane","remoteScope","parse","objects","remoteLanes","getAllRemoteLaneIds","scopeComponentImporter","ScopeComponentsImporter","getInstance","importLanes","err","InvalidScopeName","ScopeNotFoundOrDenied","LaneNotFound","InvalidScopeNameFromRemote","stop","console","message","resultFromMain","importedDeps","resultsPerLane","pMapSeries","setStatusLine","name","consoleSuccess","push","reduce","acc","curr","importLaneObject","laneId","persistIfNotExists","laneObject","exists","loadLane","saveLane","component","importedPackageNames","getImportedPackagesNames","removeFromRootPolicy","persistConfig","path","componentIdToPackageName","provider","cli","community","install","loggerMain","createLogger","ImporterAspect","importerMain","registerPreInstall","opts","registerPreLink","fetchObject","register","ImportCmd","getDocsDomain","FetchCmd","CLIAspect","WorkspaceAspect","DependencyResolverAspect","CommunityAspect","GraphAspect","ScopeAspect","ComponentWriterAspect","InstallAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["importer.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport { BitId, InvalidScopeName, InvalidScopeNameFromRemote } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport ComponentWriterAspect, { ComponentWriterMain } from '@teambit/component-writer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport InstallAspect, { InstallMain } from '@teambit/install';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { ScopeNotFoundOrDenied } from '@teambit/legacy/dist/remotes/exceptions/scope-not-found-or-denied';\nimport GraphAspect, { GraphMain } from '@teambit/graph';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { BitError } from '@teambit/bit-error';\nimport { ImportCmd } from './import.cmd';\nimport { ImporterAspect } from './importer.aspect';\nimport { FetchCmd } from './fetch-cmd';\nimport ImportComponents, { ImportOptions, ImportResult } from './import-components';\n\nexport class ImporterMain {\n constructor(\n private workspace: Workspace,\n private depResolver: DependencyResolverMain,\n private graph: GraphMain,\n private scope: ScopeMain,\n private componentWriter: ComponentWriterMain,\n private logger: Logger\n ) {}\n\n async import(importOptions: ImportOptions, packageManagerArgs: string[]): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n consumer.packageManagerArgs = packageManagerArgs;\n if (!importOptions.ids.length) {\n importOptions.objectsOnly = true;\n }\n if (this.workspace.consumer.isOnLane()) {\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneIds: [currentRemoteLane.toLaneId()], lanes: [currentRemoteLane] };\n } else if (!importOptions.ids.length) {\n // this is probably a local lane that was never exported.\n // although no need to fetch from the lane, still, the import is needed for main (which are available on this\n // local lane)\n const currentLaneId = this.workspace.getCurrentLaneId();\n importOptions.lanes = { laneIds: [currentLaneId], lanes: [] };\n }\n }\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n const results = await importComponents.importComponents();\n Analytics.setExtraData('num_components', results.importedIds.length);\n if (results.writtenComponents && results.writtenComponents.length) {\n await this.removeFromWorkspaceConfig(results.writtenComponents);\n }\n await consumer.onDestroy();\n return results;\n }\n\n /**\n * fetch objects according to the criteria set by `options` param.\n * to fetch current objects according to the current lane or main, use `this.importCurrentObjects()`.\n */\n async importObjects(options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n const importOptions: ImportOptions = {\n ...options,\n objectsOnly: true,\n ids: options.ids || [],\n installNpmPackages: false,\n };\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n return importComponents.importComponents();\n }\n\n /**\n * if on main, fetch main objects, if on lane, fetch lane objects.\n */\n async importCurrentObjects(): Promise<ImportResult> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n installNpmPackages: false,\n };\n const currentRemoteLane = await this.workspace.getCurrentRemoteLane();\n if (currentRemoteLane) {\n importOptions.lanes = { laneIds: [currentRemoteLane.toLaneId()], lanes: [currentRemoteLane] };\n }\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n return importComponents.importComponents();\n }\n\n async importObjectsFromMainIfExist(ids: BitId[]) {\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(BitIds.fromArray(ids), {\n cache: false,\n includeVersionHistory: true,\n ignoreMissingHead: true,\n });\n }\n\n async fetchLaneWithComponents(lane: Lane, options: Partial<ImportOptions> = {}): Promise<ImportResult> {\n options.lanes = { laneIds: [lane.toLaneId()], lanes: [lane] };\n return this.importObjects(options);\n }\n\n async fetch(ids: string[], lanes: boolean, components: boolean, fromOriginalScope: boolean, allHistory = false) {\n if (!lanes && !components) {\n throw new BitError(\n `please provide the type of objects you would like to pull, the options are --components and --lanes`\n );\n }\n loader.start('fetching objects...');\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n\n if (lanes) {\n const lanesToFetch = await getLanes(this.logger);\n const shouldFetchFromMain = !ids.length || ids.includes(DEFAULT_LANE);\n return this.fetchLanes(lanesToFetch, shouldFetchFromMain, { allHistory });\n }\n\n const importOptions: ImportOptions = {\n ids,\n objectsOnly: true,\n allHistory,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n fromOriginalScope,\n };\n\n const importComponents = new ImportComponents(this.workspace, this.graph, this.componentWriter, importOptions);\n const { importedIds, importDetails } = await importComponents.importComponents();\n Analytics.setExtraData('num_components', importedIds.length);\n await consumer.onDestroy();\n return { importedIds, importDetails };\n\n async function getLanes(logger: Logger): Promise<Lane[]> {\n let remoteLaneIds: LaneId[] = [];\n if (ids.length) {\n remoteLaneIds = ids\n .filter((id) => id !== DEFAULT_LANE)\n .map((id) => {\n const trackLane = consumer.scope.lanes.getRemoteTrackedDataByLocalLane(id);\n if (trackLane) return LaneId.from(trackLane.remoteLane, trackLane.remoteScope);\n return LaneId.parse(id);\n });\n } else {\n remoteLaneIds = await consumer.scope.objects.remoteLanes.getAllRemoteLaneIds();\n }\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(consumer.scope);\n try {\n return await scopeComponentImporter.importLanes(remoteLaneIds);\n } catch (err) {\n if (\n err instanceof InvalidScopeName ||\n err instanceof ScopeNotFoundOrDenied ||\n err instanceof LaneNotFound ||\n err instanceof InvalidScopeNameFromRemote\n ) {\n // the lane could be a local lane so no need to throw an error in such case\n loader.stop();\n logger.console(`unable to get lane's data from a remote due to an error:\\n${err.message}`, 'warn', 'yellow');\n } else {\n throw err;\n }\n }\n\n return [];\n }\n }\n\n async fetchLanes(\n lanes: Lane[],\n shouldFetchFromMain?: boolean,\n options: Partial<ImportOptions> = {}\n ): Promise<ImportResult> {\n const resultFromMain = shouldFetchFromMain\n ? await this.importObjects(options)\n : { importedIds: [], importDetails: [], importedDeps: [] };\n const resultsPerLane = await pMapSeries(lanes, async (lane) => {\n this.logger.setStatusLine(`fetching lane ${lane.name}`);\n const results = await this.fetchLaneWithComponents(lane, options);\n this.logger.consoleSuccess();\n return results;\n });\n resultsPerLane.push(resultFromMain);\n const results = resultsPerLane.reduce((acc, curr) => {\n acc.importedIds.push(...curr.importedIds);\n acc.importDetails.push(...curr.importDetails);\n return acc;\n });\n return results;\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const results = await legacyScope.scopeImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n private async removeFromWorkspaceConfig(component: ConsumerComponent[]) {\n const importedPackageNames = this.getImportedPackagesNames(component);\n this.depResolver.removeFromRootPolicy(importedPackageNames);\n await this.depResolver.persistConfig(this.workspace.path);\n }\n\n private getImportedPackagesNames(components: ConsumerComponent[]): string[] {\n return components.map((component) => componentIdToPackageName(component));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n DependencyResolverAspect,\n CommunityAspect,\n GraphAspect,\n ScopeAspect,\n ComponentWriterAspect,\n InstallAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, depResolver, community, graph, scope, componentWriter, install, loggerMain]: [\n CLIMain,\n Workspace,\n DependencyResolverMain,\n CommunityMain,\n GraphMain,\n ScopeMain,\n ComponentWriterMain,\n InstallMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(ImporterAspect.id);\n const importerMain = new ImporterMain(workspace, depResolver, graph, scope, componentWriter, logger);\n install.registerPreInstall(async (opts) => {\n if (!opts?.import) return;\n logger.setStatusLine('importing missing objects');\n await importerMain.importCurrentObjects();\n logger.consoleSuccess();\n });\n install.registerPreLink(async (opts) => {\n if (opts?.fetchObject) await importerMain.importCurrentObjects();\n });\n cli.register(new ImportCmd(importerMain, community.getDocsDomain()), new FetchCmd(importerMain));\n return importerMain;\n }\n}\n\nImporterAspect.addRuntime(ImporterMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;E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CAAC;IACFsB,OAAO,CAACO,eAAe,CAAC,MAAOD,IAAI,IAAK;MACtC,IAAIA,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEE,WAAW,EAAE,MAAMJ,YAAY,CAACvF,oBAAoB,EAAE;IAClE,CAAC,CAAC;IACFiF,GAAG,CAACW,QAAQ,CAAC,KAAIC,mBAAS,EAACN,YAAY,EAAEL,SAAS,CAACY,aAAa,EAAE,CAAC,EAAE,KAAIC,oBAAQ,EAACR,YAAY,CAAC,CAAC;IAChG,OAAOA,YAAY;EACrB;AACF;AAAC;AAAA,gCAvPY3H,YAAY,WAiNR,EAAE;AAAA,gCAjNNA,YAAY,kBAkND,CACpBoI,gBAAS,EACTC,oBAAe,EACfC,8CAAwB,EACxBC,4BAAe,EACfC,gBAAW,EACXC,gBAAW,EACXC,0BAAqB,EACrBC,kBAAa,EACbC,sBAAY,CACb;AAAA,gCA5NU5I,YAAY,aA6NN6I,kBAAW;AA4B9BnB,0BAAc,CAACoB,UAAU,CAAC9I,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.422/dist/importer.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.422/dist/importer.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.424/dist/importer.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.424/dist/importer.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/importer",
3
- "version": "0.0.422",
3
+ "version": "0.0.424",
4
4
  "homepage": "https://bit.dev/teambit/scope/importer",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.scope",
8
8
  "name": "importer",
9
- "version": "0.0.422"
9
+ "version": "0.0.424"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -16,19 +16,19 @@
16
16
  "core-js": "^3.0.0",
17
17
  "@babel/runtime": "7.20.0",
18
18
  "@teambit/harmony": "0.4.6",
19
- "@teambit/cli": "0.0.667",
19
+ "@teambit/cli": "0.0.668",
20
20
  "@teambit/legacy-bit-id": "0.0.423",
21
21
  "@teambit/bit-error": "0.0.402",
22
- "@teambit/component-writer": "0.0.29",
23
- "@teambit/graph": "0.0.993",
24
- "@teambit/lane-id": "0.0.184",
25
- "@teambit/workspace": "0.0.993",
26
- "@teambit/merging": "0.0.308",
27
- "@teambit/community": "0.0.215",
28
- "@teambit/dependency-resolver": "0.0.993",
29
- "@teambit/install": "0.0.116",
30
- "@teambit/logger": "0.0.760",
31
- "@teambit/scope": "0.0.993"
22
+ "@teambit/component-writer": "0.0.31",
23
+ "@teambit/graph": "0.0.995",
24
+ "@teambit/lane-id": "0.0.185",
25
+ "@teambit/workspace": "0.0.995",
26
+ "@teambit/merging": "0.0.310",
27
+ "@teambit/community": "0.0.216",
28
+ "@teambit/dependency-resolver": "0.0.995",
29
+ "@teambit/install": "0.0.117",
30
+ "@teambit/logger": "0.0.761",
31
+ "@teambit/scope": "0.0.995"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/lodash": "4.14.165",
@@ -40,7 +40,7 @@
40
40
  "@types/testing-library__jest-dom": "5.9.5"
41
41
  },
42
42
  "peerDependencies": {
43
- "@teambit/legacy": "1.0.448",
43
+ "@teambit/legacy": "1.0.449",
44
44
  "react": "^16.8.0 || ^17.0.0",
45
45
  "react-dom": "^16.8.0 || ^17.0.0"
46
46
  },