@teambit/importer 1.0.955 → 1.0.957

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.
@@ -97,9 +97,14 @@ export default class ImportComponents {
97
97
  importSpecificComponents(): Promise<ImportResult>;
98
98
  /**
99
99
  * Import all components from all scopes of an owner, handling errors per-scope.
100
- * If a scope fails during import, log a warning and continue with other scopes.
100
+ *
101
+ * Each scope is streamed through the full fetch → write → release pipeline before the
102
+ * next one is fetched. This keeps peak memory bounded by a single scope's worth of
103
+ * `VersionDependencies` instead of the sum across all scopes, which is what used to
104
+ * blow the 4 GB heap on owners with thousands of components.
101
105
  */
102
106
  private importByOwner;
107
+ private _buildScopeWriteOpts;
103
108
  /**
104
109
  * Process imported components: merge lane if needed, write to filesystem, and return results.
105
110
  */
@@ -88,7 +88,16 @@ function _toolboxPromise() {
88
88
  };
89
89
  return data;
90
90
  }
91
+ function _harmonyModules() {
92
+ const data = require("@teambit/harmony.modules.concurrency");
93
+ _harmonyModules = function () {
94
+ return data;
95
+ };
96
+ return data;
97
+ }
91
98
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
99
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
100
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
92
101
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
93
102
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
94
103
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -184,45 +193,90 @@ class ImportComponents {
184
193
 
185
194
  /**
186
195
  * Import all components from all scopes of an owner, handling errors per-scope.
187
- * If a scope fails during import, log a warning and continue with other scopes.
196
+ *
197
+ * Each scope is streamed through the full fetch → write → release pipeline before the
198
+ * next one is fetched. This keeps peak memory bounded by a single scope's worth of
199
+ * `VersionDependencies` instead of the sum across all scopes, which is what used to
200
+ * blow the 4 GB heap on owners with thousands of components.
188
201
  */
189
202
  async importByOwner(ownerName) {
190
203
  this.logger.debug(`importByOwner, owner: ${ownerName}`);
191
-
192
- // Get components grouped by scope
193
204
  const {
194
205
  scopeIds,
195
206
  failedScopes,
196
207
  failedScopesErrors
197
208
  } = await this.lister.getRemoteCompIdsByOwnerGrouped(ownerName, this.options.includeDeprecated);
198
- const allVersionDeps = [];
199
- const allBeforeVersions = {};
209
+ const accWritten = [];
210
+ const accImportedIds = [];
211
+ const accImportedDeps = [];
212
+ const accImportDetails = [];
213
+ const accMissingIds = [];
214
+ let anyImported = false;
200
215
  const importFailedScopes = [...failedScopes];
201
216
  const allFailedScopesErrors = new Map(failedScopesErrors);
202
-
203
- // Import each scope separately with error handling
204
217
  const scopeEntries = Array.from(scopeIds.entries());
205
218
  const totalScopes = scopeEntries.length;
206
219
  let completedScopes = 0;
207
220
  for (const [scopeName, ids] of scopeEntries) {
208
221
  completedScopes++;
209
222
  this.logger.setStatusLine(`importing from ${scopeName} [${completedScopes}/${totalScopes}]`);
223
+ const idList = _componentId().ComponentIdList.fromArray(ids);
224
+ const beforeVersions = await this._getCurrentVersions(idList);
225
+
226
+ // Only the remote fetch is tolerated per-scope (a failing remote for one scope should
227
+ // not abort the whole owner import). Write/merge/validation errors below propagate.
228
+ let versionDeps;
210
229
  try {
211
- const idList = _componentId().ComponentIdList.fromArray(ids);
212
- const beforeVersions = await this._getCurrentVersions(idList);
213
- Object.assign(allBeforeVersions, beforeVersions);
214
- const versionDeps = await this._importComponentsObjects(idList, {
230
+ versionDeps = await this._importComponentsObjects(idList, {
215
231
  lane: this.remoteLane
216
232
  });
217
- allVersionDeps.push(...versionDeps);
218
- this.logger.consoleSuccess(`imported ${scopeName} (${ids.length} components)`);
219
233
  } catch (err) {
220
234
  importFailedScopes.push(scopeName);
221
235
  allFailedScopesErrors.set(scopeName, err.message);
222
236
  this.logger.consoleFailure(`failed to import ${scopeName}`);
237
+ continue;
238
+ }
239
+
240
+ // Record missing IDs (present in scope before import but not returned by fetch)
241
+ // before any early-continue so they are not under-reported on empty results.
242
+ const importedIdStrs = new Set(versionDeps.map(v => v.component.id.toStringWithoutVersion()));
243
+ for (const compIdStr of Object.keys(beforeVersions)) {
244
+ if (!importedIdStrs.has(compIdStr)) accMissingIds.push(compIdStr);
245
+ }
246
+ if (!versionDeps.length) {
247
+ this.logger.consoleSuccess(`imported ${scopeName} (0 components, nothing to import)`);
248
+ continue;
223
249
  }
250
+ anyImported = true;
251
+
252
+ // Lightweight per-scope info that doesn't depend on merge status.
253
+ for (const v of versionDeps) {
254
+ accImportedIds.push(v.component.id);
255
+ accImportedDeps.push(...v.allDependenciesIds);
256
+ }
257
+
258
+ // Hydrate + write this scope's components now, so `versionDeps` can be GC'd on the
259
+ // next iteration instead of accumulating across all scopes.
260
+ if (!this.options.objectsOnly) {
261
+ const components = await (0, _legacy3().multipleVersionDependenciesToConsumer)(versionDeps, this.scope.objects);
262
+ await this._fetchDivergeData(components);
263
+ this._throwForDivergedHistory();
264
+ this.divergeData = [];
265
+ await this.throwForComponentsFromAnotherLane(components.map(c => c.id));
266
+ const filtered = await this._filterComponentsByFilters(components);
267
+ if (filtered.length) {
268
+ const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(filtered);
269
+ await this.componentWriter.writeComponentsFiles(this._buildScopeWriteOpts(componentsToWrite));
270
+ accWritten.push(...componentsToWrite);
271
+ }
272
+ }
273
+
274
+ // Collect import details after merge-strategy processing so `this.mergeStatus`
275
+ // is populated before `_getImportDetails` reads it for `filesStatus`.
276
+ accImportDetails.push(...(await this._getImportDetails(beforeVersions, versionDeps)));
277
+ this.logger.consoleSuccess(`imported ${scopeName} (${ids.length} components)`);
224
278
  }
225
- if (!allVersionDeps.length) {
279
+ if (!anyImported) {
226
280
  throw new (_bitError().BitError)(`failed to import any components from owner "${ownerName}"`);
227
281
  }
228
282
  if (importFailedScopes.length) {
@@ -232,7 +286,38 @@ class ImportComponents {
232
286
  });
233
287
  this.logger.consoleWarning(`completed with ${importFailedScopes.length} failed scope(s):\n${failedDetails.join('\n')}`);
234
288
  }
235
- return this.processAndWriteComponents(allBeforeVersions, allVersionDeps);
289
+ let componentWriterResults;
290
+ if (!this.options.objectsOnly && accWritten.length) {
291
+ componentWriterResults = await this.componentWriter.finalizeWrite(this._buildScopeWriteOpts(accWritten, {
292
+ shouldUpdateWorkspaceConfig: true
293
+ }));
294
+ await this._saveLaneDataIfNeeded(accWritten);
295
+ }
296
+ return {
297
+ importedIds: accImportedIds,
298
+ importedDeps: accImportedDeps,
299
+ writtenComponents: accWritten,
300
+ importDetails: accImportDetails,
301
+ installationError: componentWriterResults?.installationError,
302
+ compilationError: componentWriterResults?.compilationError,
303
+ workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,
304
+ missingIds: accMissingIds,
305
+ lane: this.remoteLane
306
+ };
307
+ }
308
+ _buildScopeWriteOpts(components, extra) {
309
+ return _objectSpread({
310
+ components,
311
+ writeToPath: this.options.writeToPath,
312
+ writeConfig: this.options.writeConfig,
313
+ skipDependencyInstallation: !this.options.installNpmPackages,
314
+ skipWriteConfigFiles: !this.options.writeConfigFiles,
315
+ verbose: this.options.verbose,
316
+ throwForExistingDir: !this.options.override,
317
+ skipWritingToFs: this.options.trackOnly,
318
+ reasonForBitmapChange: 'import',
319
+ writeDeps: this.options.writeDeps
320
+ }, extra);
236
321
  }
237
322
 
238
323
  /**
@@ -290,12 +375,14 @@ class ImportComponents {
290
375
  // component is in bitmap using an older version, it throws "getDivergeData: unable to find Version X of Y"
291
376
  return;
292
377
  }
293
- await Promise.all(components.map(async component => {
378
+ await (0, _toolboxPromise().pMapPool)(components, async component => {
294
379
  const fromWorkspace = this.workspace.getIdIfExist(component.id);
295
380
  const modelComponent = await this.scope.getModelComponent(component.id);
296
381
  await modelComponent.setDivergeData(this.scope.objects, undefined, false, fromWorkspace);
297
382
  this.divergeData.push(modelComponent);
298
- }));
383
+ }, {
384
+ concurrency: (0, _harmonyModules().concurrentComponentsLimit)()
385
+ });
299
386
  }
300
387
  _throwForDivergedHistory() {
301
388
  if (this.options.merge || this.options.objectsOnly) return;
@@ -315,16 +402,21 @@ class ImportComponents {
315
402
  const currentRemoteLane = this.remoteLane?.toLaneId().isEqual(currentLaneId) ? this.remoteLane : undefined;
316
403
  const currentLane = await this.workspace.getCurrentLaneObject();
317
404
  const idsFromAnotherLane = [];
405
+ const concurrency = (0, _harmonyModules().concurrentComponentsLimit)();
318
406
  if (currentRemoteLane) {
319
- await Promise.all(bitIds.map(async bitId => {
407
+ await (0, _toolboxPromise().pMapPool)(bitIds, async bitId => {
320
408
  const isOnCurrentLane = (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentRemoteLane)) || currentLane && (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentLane));
321
409
  if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);
322
- }));
410
+ }, {
411
+ concurrency
412
+ });
323
413
  } else {
324
- await Promise.all(bitIds.map(async bitId => {
414
+ await (0, _toolboxPromise().pMapPool)(bitIds, async bitId => {
325
415
  const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);
326
416
  if (!isIdOnMain) idsFromAnotherLane.push(bitId);
327
- }));
417
+ }, {
418
+ concurrency
419
+ });
328
420
  }
329
421
  if (idsFromAnotherLane.length) {
330
422
  throw new (_bitError().BitError)(`unable to import the following component(s) as they belong to other lane(s):
@@ -547,7 +639,10 @@ to write the components from .bitmap file according to the their remote, please
547
639
  * get import details, includes the diff between the versions array before import and after import
548
640
  */
549
641
  async _getImportDetails(currentVersions, components) {
550
- const detailsP = components.map(async component => {
642
+ // Bounded concurrency: each entry does `isDeprecated` / `isRemoved`, which load and
643
+ // parse the head Version object from disk. Fanning out 4k+ of those at once (the old
644
+ // Promise.all) OOMs the heap on large imports.
645
+ const importDetails = await (0, _toolboxPromise().pMapPool)(components, async component => {
551
646
  const id = component.component.id;
552
647
  const idStr = id.toStringWithoutVersion();
553
648
  const beforeImportVersions = currentVersions[idStr];
@@ -577,8 +672,9 @@ to write the components from .bitmap file according to the their remote, please
577
672
  deprecated,
578
673
  removed
579
674
  };
675
+ }, {
676
+ concurrency: (0, _harmonyModules().concurrentComponentsLimit)()
580
677
  });
581
- const importDetails = await Promise.all(detailsP);
582
678
  return importDetails;
583
679
  }
584
680
  async _throwForPotentialIssues(ids) {
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_pMapSeries","_interopRequireDefault","_componentId","_legacy","_legacy2","_componentModules","_legacy3","_componentVersion","_lodash","_dependentsGetter","_lister","_toolboxPromise","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_IMPORT_ACTION","ImportComponents","constructor","workspace","graph","componentWriter","envs","logger","lister","options","consumer","scope","remoteLane","lanes","importComponents","result","setStatusLine","startTime","process","hrtime","ids","length","importObjectsOnLane","consoleSuccess","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","bitIds","getBitIds","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAndSaveLaneObject","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","keys","importedComps","map","c","component","toStringWithoutVersion","forEach","compIdStr","found","includes","push","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","workspaceConfigUpdateResult","owner","importByOwner","join","_throwForPotentialIssues","processAndWriteComponents","ownerName","scopeIds","failedScopes","failedScopesErrors","getRemoteCompIdsByOwnerGrouped","includeDeprecated","allVersionDeps","allBeforeVersions","importFailedScopes","allFailedScopesErrors","Map","scopeEntries","Array","from","entries","totalScopes","completedScopes","scopeName","idList","ComponentIdList","fromArray","beforeVersions","assign","versionDeps","err","set","message","consoleFailure","BitError","failedDetails","errMsg","get","consoleWarning","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","throwForComponentsFromAnotherLane","filteredComponents","_filterComponentsByFilters","_writeToFileSystem","_saveLaneDataIfNeeded","mergeLaneResults","sources","mergeLane","mergedLane","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","filterEnvs","filteredP","currentEnv","calculateEnvIdFromExtensions","extensions","currentEnvWithoutVersion","split","undefined","filtered","compact","Promise","all","fromWorkspace","getIdIfExist","modelComponent","getModelComponent","setDivergeData","divergeData","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","currentLaneId","getCurrentLaneId","currentRemoteLane","toLaneId","currentLane","getCurrentLaneObject","idsFromAnotherLane","bitId","isOnCurrentLane","isPartOfLaneHistoryOrMain","isIdOnMain","isPartOfMainHistory","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importWithoutDeps","toVersionLatest","cache","includeVersionHistory","fetchHeadIfLocalIsBehind","allHistory","collectParents","includeUnexported","isLaneFromRemote","reason","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","remoteLaneIds","toComponentIds","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","has","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","getIdFromStr","fromLane","searchWithoutVersion","hasVersion","pMapSeries","existingOnLanes","filterIdsFromPoolIdsByPattern","laneOnly","idsFromRemote","getRemoteCompIdsByWildcards","laneIds","Set","mainOnlyIds","startsWith","resolveComponentIdFromPackageName","ComponentID","fromString","getBitIdsForNonLanes","pMapPool","NoIdMatchWildcard","error","concurrency","shouldImportDependents","importDependents","dependentsVia","dependentsAll","shouldImportDependencies","importDependenciesDirectly","importHeadDependenciesDirectly","dependenciesIds","getFlattenedDepsUnique","dependentsGetter","DependentsGetter","dependents","getDependents","uniqFromArray","remoteComps","scopeImporter","getManyRemoteComponents","versions","getVersions","getFlattened","flattenedDependencies","flattenedDeps","flattened","uniqWithoutVersions","removeMultipleVersionsKeepLatest","latest","grouped","toGroupByIdWithoutVersion","latestVersions","key","getLatestVersionNumber","changeVersion","LATEST_VERSION","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","_throwForModifiedOrNewComponents","flagUsed","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","listVersions","fromPairs","currentVersions","detailsP","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","Boolean","isDeprecated","version","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","trackOnly","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getComponentId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","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","find","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","_shouldSaveLaneData","isOnLane","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setOnLanesOnly","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","skipWriteConfigFiles","writeConfigFiles","verbose","throwForExistingDir","skipWritingToFs","shouldUpdateWorkspaceConfig","reasonForBitmapChange","writeDeps","writeMany","exports"],"sources":["import-components.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport type { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentsPendingMerge } from '@teambit/legacy.consumer';\nimport type { Lane, ModelComponent, Version } from '@teambit/objects';\nimport { getLatestVersionNumber, pathNormalizeToLinux, hasWildcard } from '@teambit/legacy.utils';\nimport type { ConsumerComponent as Component } from '@teambit/legacy.consumer-component';\nimport type { MergeStrategy, MergeResultsThreeWay, FilesStatus } from '@teambit/component.modules.merge-helper';\nimport {\n applyModifiedVersion,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/component.modules.merge-helper';\nimport type { VersionDependencies, Scope } from '@teambit/legacy.scope';\nimport { multipleVersionDependenciesToConsumer, ScopeComponentsImporter } from '@teambit/legacy.scope';\nimport type { GraphMain } from '@teambit/graph';\nimport type { Workspace } from '@teambit/workspace';\nimport type {\n ComponentWriterMain,\n ComponentWriterResults,\n ManyComponentsWriterParams,\n} from '@teambit/component-writer';\nimport { LATEST_VERSION } from '@teambit/component-version';\nimport type { EnvsMain } from '@teambit/envs';\nimport { compact, difference, fromPairs } from 'lodash';\nimport type { WorkspaceConfigUpdateResult } from '@teambit/config-merger';\nimport type { Logger } from '@teambit/logger';\nimport { DependentsGetter } from './dependents-getter';\nimport type { ListerMain } from '@teambit/lister';\nimport { NoIdMatchWildcard } from '@teambit/lister';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\n\nconst BEFORE_IMPORT_ACTION = 'importing components';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n filterEnvs?: string[];\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n writeConfigFiles: boolean; // default: true\n objectsOnly?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages, not as imported\n importHeadDependenciesDirectly?: boolean; // default: false, similar to importDependenciesDirectly, but it checks out to their head\n importDependents?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean; // don't show prompt for --dependents flag\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 laneId: LaneId;\n remoteLane?: 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 trackOnly?: boolean;\n includeDeprecated?: boolean;\n isLaneFromRemote?: boolean; // whether the `lanes.lane` object is coming directly from the remote.\n writeDeps?: 'package.json' | 'workspace.jsonc';\n laneOnly?: boolean; // when on a lane, only import components that exist on the lane (preserves legacy behavior)\n owner?: boolean; // treat the id as an owner name and import all components from all scopes of that owner\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: ComponentID[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: ComponentID[];\n importedDeps: ComponentID[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n lane?: Lane;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private remoteLane: Lane | undefined;\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n private logger: Logger,\n private lister: ListerMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.remoteLane = this.options.lanes?.remoteLane;\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n const lane = this.remoteLane;\n const bitIds: ComponentIdList = await this.getBitIds();\n lane\n ? this.logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : this.logger.debug(\n `importObjectsOnLane, the lane does not exist on the remote. importing only the main components`\n );\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n if (lane) {\n await this.mergeAndSaveLaneObject(lane);\n }\n\n return this.returnCompleteResults(beforeImportVersions, versionDependenciesArr);\n }\n\n private async returnCompleteResults(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[],\n writtenComponents?: Component[],\n componentWriterResults?: ComponentWriterResults\n ): Promise<ImportResult> {\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n const missingIds: string[] = [];\n if (Object.keys(beforeImportVersions).length > versionDependenciesArr.length) {\n const importedComps = versionDependenciesArr.map((c) => c.component.id.toStringWithoutVersion());\n Object.keys(beforeImportVersions).forEach((compIdStr) => {\n const found = importedComps.includes(compIdStr);\n if (!found) missingIds.push(compIdStr);\n });\n }\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 workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n missingIds,\n lane: this.remoteLane,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n // Handle --owner flag with scope-by-scope error handling\n if (this.options.owner && this.options.ids.length === 1) {\n return this.importByOwner(this.options.ids[0]);\n }\n\n this.logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: ComponentIdList = 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.remoteLane,\n });\n\n return this.processAndWriteComponents(beforeImportVersions, versionDependenciesArr);\n }\n\n /**\n * Import all components from all scopes of an owner, handling errors per-scope.\n * If a scope fails during import, log a warning and continue with other scopes.\n */\n private async importByOwner(ownerName: string): Promise<ImportResult> {\n this.logger.debug(`importByOwner, owner: ${ownerName}`);\n\n // Get components grouped by scope\n const { scopeIds, failedScopes, failedScopesErrors } = await this.lister.getRemoteCompIdsByOwnerGrouped(\n ownerName,\n this.options.includeDeprecated\n );\n\n const allVersionDeps: VersionDependencies[] = [];\n const allBeforeVersions: ImportedVersions = {};\n const importFailedScopes: string[] = [...failedScopes];\n const allFailedScopesErrors: Map<string, string> = new Map(failedScopesErrors);\n\n // Import each scope separately with error handling\n const scopeEntries = Array.from(scopeIds.entries());\n const totalScopes = scopeEntries.length;\n let completedScopes = 0;\n for (const [scopeName, ids] of scopeEntries) {\n completedScopes++;\n this.logger.setStatusLine(`importing from ${scopeName} [${completedScopes}/${totalScopes}]`);\n try {\n const idList = ComponentIdList.fromArray(ids);\n const beforeVersions = await this._getCurrentVersions(idList);\n Object.assign(allBeforeVersions, beforeVersions);\n\n const versionDeps = await this._importComponentsObjects(idList, {\n lane: this.remoteLane,\n });\n allVersionDeps.push(...versionDeps);\n this.logger.consoleSuccess(`imported ${scopeName} (${ids.length} components)`);\n } catch (err: any) {\n importFailedScopes.push(scopeName);\n allFailedScopesErrors.set(scopeName, err.message);\n this.logger.consoleFailure(`failed to import ${scopeName}`);\n }\n }\n\n if (!allVersionDeps.length) {\n throw new BitError(`failed to import any components from owner \"${ownerName}\"`);\n }\n\n if (importFailedScopes.length) {\n const failedDetails = importFailedScopes.map((scope) => {\n const errMsg = allFailedScopesErrors.get(scope);\n return errMsg ? `${scope}: ${errMsg}` : scope;\n });\n this.logger.consoleWarning(\n `completed with ${importFailedScopes.length} failed scope(s):\\n${failedDetails.join('\\n')}`\n );\n }\n\n return this.processAndWriteComponents(allBeforeVersions, allVersionDeps);\n }\n\n /**\n * Process imported components: merge lane if needed, write to filesystem, and return results.\n */\n private async processAndWriteComponents(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[]\n ): Promise<ImportResult> {\n if (this.remoteLane && this.options.objectsOnly) {\n await this.mergeAndSaveLaneObject(this.remoteLane);\n }\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 await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n const filteredComponents = await this._filterComponentsByFilters(components);\n componentWriterResults = await this._writeToFileSystem(filteredComponents);\n await this._saveLaneDataIfNeeded(filteredComponents);\n writtenComponents = filteredComponents;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private async mergeAndSaveLaneObject(lane: Lane) {\n const mergeLaneResults = await this.scope.sources.mergeLane(lane, true);\n const mergedLane = mergeLaneResults.mergeLane;\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergedLane);\n await this.scope.lanes.saveLane(mergedLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'import (merge from remote)',\n });\n }\n\n private async _filterComponentsByFilters(components: Component[]): Promise<Component[]> {\n if (!this.options.filterEnvs) return components;\n const filteredP = components.map(async (component) => {\n // If the id was requested explicitly, we don't want to filter it out\n if (this.options.ids) {\n if (\n this.options.ids.includes(component.id.toStringWithoutVersion()) ||\n this.options.ids.includes(component.id.toString())\n ) {\n return component;\n }\n }\n const currentEnv = await this.envs.calculateEnvIdFromExtensions(component.extensions);\n const currentEnvWithoutVersion = currentEnv.split('@')[0];\n if (\n this.options.filterEnvs?.includes(currentEnv) ||\n this.options.filterEnvs?.includes(currentEnvWithoutVersion)\n ) {\n return component;\n }\n return undefined;\n });\n const filtered = compact(await Promise.all(filteredP));\n return filtered;\n }\n\n private 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 fromWorkspace = this.workspace.getIdIfExist(component.id);\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false, fromWorkspace);\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 throwForComponentsFromAnotherLane(bitIds: ComponentID[]) {\n if (this.options.objectsOnly) return;\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentRemoteLane = this.remoteLane?.toLaneId().isEqual(currentLaneId) ? this.remoteLane : undefined;\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idsFromAnotherLane: ComponentID[] = [];\n if (currentRemoteLane) {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isOnCurrentLane =\n (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentRemoteLane)) ||\n (currentLane && (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentLane)));\n if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);\n })\n );\n } else {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);\n if (!isIdOnMain) idsFromAnotherLane.push(bitId);\n })\n );\n }\n if (idsFromAnotherLane.length) {\n throw new BitError(`unable to import the following component(s) as they belong to other lane(s):\n${idsFromAnotherLane.map((id) => id.toString()).join(', ')}\nif you need this specific snap, find the lane this snap is belong to, then run \"bit lane merge <lane-id> [component-id]\" to merge this component from the lane.\nif you just want to get a quick look into this snap, create a new workspace and import it by running \"bit lane import <lane-id> --pattern <component-id>\"`);\n }\n }\n\n private async _importComponentsObjects(\n ids: ComponentIdList,\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.importWithoutDeps(ids.toVersionLatest(), {\n cache: false,\n lane,\n includeVersionHistory: true,\n fetchHeadIfLocalIsBehind: !this.options.allHistory,\n collectParents: this.options.allHistory,\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 includeUnexported: this.options.isLaneFromRemote,\n reason: `of their latest on ${lane ? `lane ${lane.id()}` : 'main'}`,\n });\n\n this.logger.setStatusLine(`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 lane,\n preferDependencyGraph: !this.options.fetchDeps,\n // 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 reFetchUnBuiltVersion: true,\n // it's possible that .bitmap is not in sync and has local tags that don't exist on the remote. later, we\n // add them to \"missingIds\" of \"importResult\" and show them to the user\n throwForSeederNotFound: false,\n reason: this.options.fetchDeps\n ? 'for getting all dependencies'\n : `for getting dependencies of components that don't have dependency-graph`,\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. by default, imports from both lane and main (lane versions preferred).\n * if --lane-only flag is specified, import only components that exist 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<ComponentID[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const remoteLaneIds = this.remoteLane?.toComponentIds() || new ComponentIdList();\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !remoteLaneIds.has(id));\n remoteLaneIds.push(...bitMapIdsToImport);\n\n return remoteLaneIds;\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 = await Promise.all(\n idsWithoutWildcard.map(async (idStr) => {\n const id = await this.getIdFromStr(idStr);\n const fromLane = remoteLaneIds.searchWithoutVersion(id);\n return fromLane && !id.hasVersion() ? fromLane : id;\n })\n );\n\n const bitIds: ComponentID[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const existingOnLanes = await this.workspace.filterIdsFromPoolIdsByPattern(idStr, remoteLaneIds, false);\n\n if (this.options.laneOnly) {\n // When --lane-only is specified, import only components that exist on the lane, never from main\n bitIds.push(...existingOnLanes);\n } else {\n // New default behavior: Import from both lane and main\n // Get all components matching the pattern from main\n const idsFromRemote = await this.lister.getRemoteCompIdsByWildcards(idStr, this.options.includeDeprecated);\n\n // Prefer lane versions where they exist, use main versions for the rest\n const laneIds = new Set(existingOnLanes.map((id) => id.toStringWithoutVersion()));\n const mainOnlyIds = idsFromRemote.filter((id) => !laneIds.has(id.toStringWithoutVersion()));\n\n bitIds.push(...existingOnLanes, ...mainOnlyIds);\n }\n });\n\n return bitIds;\n }\n\n private async getIdFromStr(id: string): Promise<ComponentID> {\n if (id.startsWith('@')) return this.workspace.resolveComponentIdFromPackageName(id);\n return ComponentID.fromString(id); // we don't support importing without a scope name\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: ComponentID[] = [];\n\n await pMapPool(\n this.options.ids,\n async (idStr: string) => {\n if (hasWildcard(idStr)) {\n let ids: ComponentID[] = [];\n try {\n ids = await this.lister.getRemoteCompIdsByWildcards(idStr, this.options.includeDeprecated);\n } catch (err: any) {\n if (err instanceof NoIdMatchWildcard) {\n this.logger.consoleWarning(err.message);\n } else {\n this.logger.error(`failed getting the list of components by the wildcard ${idStr}`);\n throw err;\n }\n }\n bitIds.push(...ids);\n } else {\n const id = await this.getIdFromStr(idStr);\n bitIds.push(id);\n }\n },\n { concurrency: 30 }\n );\n\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<ComponentIdList> {\n const bitIds: ComponentID[] = this.options.lanes\n ? await this.getBitIdsForLanes()\n : await this.getBitIdsForNonLanes();\n const shouldImportDependents =\n this.options.importDependents || this.options.dependentsVia || this.options.dependentsAll;\n const shouldImportDependencies =\n this.options.importDependenciesDirectly || this.options.importHeadDependenciesDirectly;\n if (shouldImportDependencies || shouldImportDependents) {\n if (shouldImportDependencies) {\n const dependenciesIds = await this.getFlattenedDepsUnique(bitIds);\n bitIds.push(...dependenciesIds);\n }\n if (shouldImportDependents) {\n const dependentsGetter = new DependentsGetter(this.logger, this.workspace, this.graph, this.options);\n const dependents = await dependentsGetter.getDependents(bitIds);\n bitIds.push(...dependents);\n }\n }\n return ComponentIdList.uniqFromArray(bitIds);\n }\n\n private async getFlattenedDepsUnique(bitIds: ComponentID[]): Promise<ComponentID[]> {\n const remoteComps = await this.scope.scopeImporter.getManyRemoteComponents(bitIds);\n const versions = remoteComps.getVersions();\n const getFlattened = (): ComponentIdList => {\n if (versions.length === 1) return versions[0].flattenedDependencies;\n const flattenedDeps = versions.map((v) => v.flattenedDependencies).flat();\n return ComponentIdList.uniqFromArray(flattenedDeps);\n };\n const flattened = getFlattened();\n return this.options.importHeadDependenciesDirectly\n ? this.uniqWithoutVersions(flattened)\n : this.removeMultipleVersionsKeepLatest(flattened);\n }\n\n private uniqWithoutVersions(flattened: ComponentIdList) {\n const latest = flattened.toVersionLatest();\n return ComponentIdList.uniqFromArray(latest);\n }\n\n private removeMultipleVersionsKeepLatest(flattened: ComponentIdList): ComponentID[] {\n const grouped = flattened.toGroupByIdWithoutVersion();\n const latestVersions = Object.keys(grouped).map((key) => {\n const ids = grouped[key];\n if (ids.length === 1) return ids[0];\n try {\n const latest = getLatestVersionNumber(ids, ids[0].changeVersion(LATEST_VERSION));\n return latest;\n } catch (err: any) {\n throw new Error(`a dependency \"${key}\" was found with multiple versions, unable to find which one of them is newer.\nerror: ${err.message}\nconsider running with \"--dependencies-head\" flag instead, which checks out to the head of the dependencies`);\n }\n });\n\n return latestVersions;\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 (!componentsIdsToImport.length) {\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 const flagUsed = this.options.merge ? '--merge' : '--override';\n throw new Error(`bit import with no ids and ${flagUsed} flag is not supported.\nto write the components from .bitmap file according to the their remote, please use \"bit checkout reset --all\"`);\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 return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return ComponentIdList.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: ComponentIdList): 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 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 BitError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = 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 = Boolean(await modelComponent.isDeprecated(this.scope.objects, id.version));\n const removed = Boolean(await component.component.component.isRemoved(this.scope.objects, id.version));\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 const importDetails: ImportDetails[] = await Promise.all(detailsP);\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: ComponentIdList): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: ComponentIdList): 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 || this.options.trackOnly) return;\n const componentsStatuses = await this.workspace.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 BitError(\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 * 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: ComponentIdList): void {\n ids.forEach((id: ComponentID) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local (new/staged) component with the same name.\nit's fine to have components with the same name as long as their scope names are different.\nif the component was created by mistake, remove it and import the remote one.\notherwise, if tagged/snapped, \"bit reset\" it, then bit rename it.`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.workspace.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.getComponentId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(component.id.version, this.consumer.scope.objects);\n const mergeResults = await threeWayMerge({\n scope: this.consumer.scope,\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 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 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 return compact(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 = this.remoteLane?.toComponentIds() || new ComponentIdList();\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.setOnLanesOnly(comp.id, 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, { laneHistoryMsg: 'import components' });\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n skipWriteConfigFiles: !this.options.writeConfigFiles,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n shouldUpdateWorkspaceConfig: true,\n reasonForBitmapChange: 'import',\n writeDeps: this.options.writeDeps,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,kBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,iBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA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;MAC3CwG,eAAe,EAAE,IAAI,CAAC3V,OAAO,CAACmR,SAAS;MACvCyE,2BAA2B,EAAE,IAAI;MACjCC,qBAAqB,EAAE,QAAQ;MAC/BC,SAAS,EAAE,IAAI,CAAC9V,OAAO,CAAC8V;IAC1B,CAAC;IACD,OAAO,IAAI,CAAClW,eAAe,CAACmW,SAAS,CAACb,wBAAwB,CAAC;EACjE;AACF;AAACc,OAAA,CAAA5X,OAAA,GAAAoB,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","_pMapSeries","_interopRequireDefault","_componentId","_legacy","_legacy2","_componentModules","_legacy3","_componentVersion","_lodash","_dependentsGetter","_lister","_toolboxPromise","_harmonyModules","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_IMPORT_ACTION","ImportComponents","constructor","workspace","graph","componentWriter","envs","logger","lister","options","consumer","scope","remoteLane","lanes","importComponents","result","setStatusLine","startTime","process","hrtime","ids","importObjectsOnLane","consoleSuccess","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","bitIds","getBitIds","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAndSaveLaneObject","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","importedComps","map","c","component","toStringWithoutVersion","compIdStr","found","includes","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","workspaceConfigUpdateResult","owner","importByOwner","join","_throwForPotentialIssues","processAndWriteComponents","ownerName","scopeIds","failedScopes","failedScopesErrors","getRemoteCompIdsByOwnerGrouped","includeDeprecated","accWritten","accImportedIds","accImportedDeps","accImportDetails","accMissingIds","anyImported","importFailedScopes","allFailedScopesErrors","Map","scopeEntries","Array","from","entries","totalScopes","completedScopes","scopeName","idList","ComponentIdList","fromArray","beforeVersions","versionDeps","err","set","message","consoleFailure","importedIdStrs","Set","has","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","divergeData","throwForComponentsFromAnotherLane","filtered","_filterComponentsByFilters","componentsToWrite","updateAllComponentsAccordingToMergeStrategy","writeComponentsFiles","_buildScopeWriteOpts","BitError","failedDetails","errMsg","get","consoleWarning","finalizeWrite","shouldUpdateWorkspaceConfig","_saveLaneDataIfNeeded","extra","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","skipWriteConfigFiles","writeConfigFiles","verbose","throwForExistingDir","override","skipWritingToFs","trackOnly","reasonForBitmapChange","writeDeps","filteredComponents","_writeToFileSystem","mergeLaneResults","sources","mergeLane","mergedLane","isRemoteLaneEqualsToMergedLane","isEqual","saveLane","saveLaneHistory","laneHistoryMsg","filterEnvs","filteredP","currentEnv","calculateEnvIdFromExtensions","extensions","currentEnvWithoutVersion","split","undefined","compact","Promise","all","pMapPool","fromWorkspace","getIdIfExist","modelComponent","getModelComponent","setDivergeData","concurrency","concurrentComponentsLimit","merge","divergedComponents","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","currentLaneId","getCurrentLaneId","currentRemoteLane","toLaneId","currentLane","getCurrentLaneObject","idsFromAnotherLane","bitId","isOnCurrentLane","isPartOfLaneHistoryOrMain","isIdOnMain","isPartOfMainHistory","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importWithoutDeps","toVersionLatest","cache","includeVersionHistory","fetchHeadIfLocalIsBehind","allHistory","collectParents","includeUnexported","isLaneFromRemote","reason","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","remoteLaneIds","toComponentIds","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","getIdFromStr","fromLane","searchWithoutVersion","hasVersion","pMapSeries","existingOnLanes","filterIdsFromPoolIdsByPattern","laneOnly","idsFromRemote","getRemoteCompIdsByWildcards","laneIds","mainOnlyIds","startsWith","resolveComponentIdFromPackageName","ComponentID","fromString","getBitIdsForNonLanes","NoIdMatchWildcard","error","shouldImportDependents","importDependents","dependentsVia","dependentsAll","shouldImportDependencies","importDependenciesDirectly","importHeadDependenciesDirectly","dependenciesIds","getFlattenedDepsUnique","dependentsGetter","DependentsGetter","dependents","getDependents","uniqFromArray","remoteComps","scopeImporter","getManyRemoteComponents","versions","getVersions","getFlattened","flattenedDependencies","flattenedDeps","flattened","uniqWithoutVersions","removeMultipleVersionsKeepLatest","latest","grouped","toGroupByIdWithoutVersion","latestVersions","key","getLatestVersionNumber","changeVersion","LATEST_VERSION","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","_throwForModifiedOrNewComponents","flagUsed","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","listVersions","fromPairs","currentVersions","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","Boolean","isDeprecated","version","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getComponentId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","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","componentsStatusP","componentsStatus","componentWithConflict","find","getMergeStrategyInteractive","unchangedFiles","_shouldSaveLaneData","isOnLane","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setOnLanesOnly","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeMany","exports"],"sources":["import-components.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport type { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentsPendingMerge } from '@teambit/legacy.consumer';\nimport type { Lane, ModelComponent, Version } from '@teambit/objects';\nimport { getLatestVersionNumber, pathNormalizeToLinux, hasWildcard } from '@teambit/legacy.utils';\nimport type { ConsumerComponent as Component } from '@teambit/legacy.consumer-component';\nimport type { MergeStrategy, MergeResultsThreeWay, FilesStatus } from '@teambit/component.modules.merge-helper';\nimport {\n applyModifiedVersion,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/component.modules.merge-helper';\nimport type { VersionDependencies, Scope } from '@teambit/legacy.scope';\nimport { multipleVersionDependenciesToConsumer, ScopeComponentsImporter } from '@teambit/legacy.scope';\nimport type { GraphMain } from '@teambit/graph';\nimport type { Workspace } from '@teambit/workspace';\nimport type {\n ComponentWriterMain,\n ComponentWriterResults,\n ManyComponentsWriterParams,\n} from '@teambit/component-writer';\nimport { LATEST_VERSION } from '@teambit/component-version';\nimport type { EnvsMain } from '@teambit/envs';\nimport { compact, difference, fromPairs } from 'lodash';\nimport type { WorkspaceConfigUpdateResult } from '@teambit/config-merger';\nimport type { Logger } from '@teambit/logger';\nimport { DependentsGetter } from './dependents-getter';\nimport type { ListerMain } from '@teambit/lister';\nimport { NoIdMatchWildcard } from '@teambit/lister';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';\n\nconst BEFORE_IMPORT_ACTION = 'importing components';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n filterEnvs?: string[];\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n writeConfigFiles: boolean; // default: true\n objectsOnly?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages, not as imported\n importHeadDependenciesDirectly?: boolean; // default: false, similar to importDependenciesDirectly, but it checks out to their head\n importDependents?: boolean;\n dependentsVia?: string;\n dependentsAll?: boolean;\n silent?: boolean; // don't show prompt for --dependents flag\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 laneId: LaneId;\n remoteLane?: 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 trackOnly?: boolean;\n includeDeprecated?: boolean;\n isLaneFromRemote?: boolean; // whether the `lanes.lane` object is coming directly from the remote.\n writeDeps?: 'package.json' | 'workspace.jsonc';\n laneOnly?: boolean; // when on a lane, only import components that exist on the lane (preserves legacy behavior)\n owner?: boolean; // treat the id as an owner name and import all components from all scopes of that owner\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: ComponentID[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: ComponentID[];\n importedDeps: ComponentID[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n lane?: Lane;\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private remoteLane: Lane | undefined;\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n private envs: EnvsMain,\n private logger: Logger,\n private lister: ListerMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.remoteLane = this.options.lanes?.remoteLane;\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n this.logger.consoleSuccess(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n const lane = this.remoteLane;\n const bitIds: ComponentIdList = await this.getBitIds();\n lane\n ? this.logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : this.logger.debug(\n `importObjectsOnLane, the lane does not exist on the remote. importing only the main components`\n );\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n if (lane) {\n await this.mergeAndSaveLaneObject(lane);\n }\n\n return this.returnCompleteResults(beforeImportVersions, versionDependenciesArr);\n }\n\n private async returnCompleteResults(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[],\n writtenComponents?: Component[],\n componentWriterResults?: ComponentWriterResults\n ): Promise<ImportResult> {\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n const missingIds: string[] = [];\n if (Object.keys(beforeImportVersions).length > versionDependenciesArr.length) {\n const importedComps = versionDependenciesArr.map((c) => c.component.id.toStringWithoutVersion());\n Object.keys(beforeImportVersions).forEach((compIdStr) => {\n const found = importedComps.includes(compIdStr);\n if (!found) missingIds.push(compIdStr);\n });\n }\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 workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n missingIds,\n lane: this.remoteLane,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n // Handle --owner flag with scope-by-scope error handling\n if (this.options.owner && this.options.ids.length === 1) {\n return this.importByOwner(this.options.ids[0]);\n }\n\n this.logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: ComponentIdList = 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.remoteLane,\n });\n\n return this.processAndWriteComponents(beforeImportVersions, versionDependenciesArr);\n }\n\n /**\n * Import all components from all scopes of an owner, handling errors per-scope.\n *\n * Each scope is streamed through the full fetch → write → release pipeline before the\n * next one is fetched. This keeps peak memory bounded by a single scope's worth of\n * `VersionDependencies` instead of the sum across all scopes, which is what used to\n * blow the 4 GB heap on owners with thousands of components.\n */\n private async importByOwner(ownerName: string): Promise<ImportResult> {\n this.logger.debug(`importByOwner, owner: ${ownerName}`);\n\n const { scopeIds, failedScopes, failedScopesErrors } = await this.lister.getRemoteCompIdsByOwnerGrouped(\n ownerName,\n this.options.includeDeprecated\n );\n\n const accWritten: Component[] = [];\n const accImportedIds: ComponentID[] = [];\n const accImportedDeps: ComponentID[] = [];\n const accImportDetails: ImportDetails[] = [];\n const accMissingIds: string[] = [];\n let anyImported = false;\n\n const importFailedScopes: string[] = [...failedScopes];\n const allFailedScopesErrors: Map<string, string> = new Map(failedScopesErrors);\n\n const scopeEntries = Array.from(scopeIds.entries());\n const totalScopes = scopeEntries.length;\n let completedScopes = 0;\n for (const [scopeName, ids] of scopeEntries) {\n completedScopes++;\n this.logger.setStatusLine(`importing from ${scopeName} [${completedScopes}/${totalScopes}]`);\n const idList = ComponentIdList.fromArray(ids);\n const beforeVersions = await this._getCurrentVersions(idList);\n\n // Only the remote fetch is tolerated per-scope (a failing remote for one scope should\n // not abort the whole owner import). Write/merge/validation errors below propagate.\n let versionDeps: VersionDependencies[];\n try {\n versionDeps = await this._importComponentsObjects(idList, {\n lane: this.remoteLane,\n });\n } catch (err: any) {\n importFailedScopes.push(scopeName);\n allFailedScopesErrors.set(scopeName, err.message);\n this.logger.consoleFailure(`failed to import ${scopeName}`);\n continue;\n }\n\n // Record missing IDs (present in scope before import but not returned by fetch)\n // before any early-continue so they are not under-reported on empty results.\n const importedIdStrs = new Set(versionDeps.map((v) => v.component.id.toStringWithoutVersion()));\n for (const compIdStr of Object.keys(beforeVersions)) {\n if (!importedIdStrs.has(compIdStr)) accMissingIds.push(compIdStr);\n }\n\n if (!versionDeps.length) {\n this.logger.consoleSuccess(`imported ${scopeName} (0 components, nothing to import)`);\n continue;\n }\n anyImported = true;\n\n // Lightweight per-scope info that doesn't depend on merge status.\n for (const v of versionDeps) {\n accImportedIds.push(v.component.id);\n accImportedDeps.push(...v.allDependenciesIds);\n }\n\n // Hydrate + write this scope's components now, so `versionDeps` can be GC'd on the\n // next iteration instead of accumulating across all scopes.\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDeps, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n this.divergeData = [];\n await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n const filtered = await this._filterComponentsByFilters(components);\n if (filtered.length) {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(filtered);\n await this.componentWriter.writeComponentsFiles(this._buildScopeWriteOpts(componentsToWrite));\n accWritten.push(...componentsToWrite);\n }\n }\n\n // Collect import details after merge-strategy processing so `this.mergeStatus`\n // is populated before `_getImportDetails` reads it for `filesStatus`.\n accImportDetails.push(...(await this._getImportDetails(beforeVersions, versionDeps)));\n\n this.logger.consoleSuccess(`imported ${scopeName} (${ids.length} components)`);\n }\n\n if (!anyImported) {\n throw new BitError(`failed to import any components from owner \"${ownerName}\"`);\n }\n\n if (importFailedScopes.length) {\n const failedDetails = importFailedScopes.map((scope) => {\n const errMsg = allFailedScopesErrors.get(scope);\n return errMsg ? `${scope}: ${errMsg}` : scope;\n });\n this.logger.consoleWarning(\n `completed with ${importFailedScopes.length} failed scope(s):\\n${failedDetails.join('\\n')}`\n );\n }\n\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly && accWritten.length) {\n componentWriterResults = await this.componentWriter.finalizeWrite(\n this._buildScopeWriteOpts(accWritten, { shouldUpdateWorkspaceConfig: true })\n );\n await this._saveLaneDataIfNeeded(accWritten);\n }\n\n return {\n importedIds: accImportedIds,\n importedDeps: accImportedDeps,\n writtenComponents: accWritten,\n importDetails: accImportDetails,\n installationError: componentWriterResults?.installationError,\n compilationError: componentWriterResults?.compilationError,\n workspaceConfigUpdateResult: componentWriterResults?.workspaceConfigUpdateResult,\n missingIds: accMissingIds,\n lane: this.remoteLane,\n };\n }\n\n private _buildScopeWriteOpts(\n components: Component[],\n extra?: Partial<ManyComponentsWriterParams>\n ): ManyComponentsWriterParams {\n return {\n components,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n skipWriteConfigFiles: !this.options.writeConfigFiles,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n reasonForBitmapChange: 'import',\n writeDeps: this.options.writeDeps,\n ...extra,\n };\n }\n\n /**\n * Process imported components: merge lane if needed, write to filesystem, and return results.\n */\n private async processAndWriteComponents(\n beforeImportVersions: ImportedVersions,\n versionDependenciesArr: VersionDependencies[]\n ): Promise<ImportResult> {\n if (this.remoteLane && this.options.objectsOnly) {\n await this.mergeAndSaveLaneObject(this.remoteLane);\n }\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 await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n const filteredComponents = await this._filterComponentsByFilters(components);\n componentWriterResults = await this._writeToFileSystem(filteredComponents);\n await this._saveLaneDataIfNeeded(filteredComponents);\n writtenComponents = filteredComponents;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private async mergeAndSaveLaneObject(lane: Lane) {\n const mergeLaneResults = await this.scope.sources.mergeLane(lane, true);\n const mergedLane = mergeLaneResults.mergeLane;\n const isRemoteLaneEqualsToMergedLane = lane.isEqual(mergedLane);\n await this.scope.lanes.saveLane(mergedLane, {\n saveLaneHistory: !isRemoteLaneEqualsToMergedLane,\n laneHistoryMsg: 'import (merge from remote)',\n });\n }\n\n private async _filterComponentsByFilters(components: Component[]): Promise<Component[]> {\n if (!this.options.filterEnvs) return components;\n const filteredP = components.map(async (component) => {\n // If the id was requested explicitly, we don't want to filter it out\n if (this.options.ids) {\n if (\n this.options.ids.includes(component.id.toStringWithoutVersion()) ||\n this.options.ids.includes(component.id.toString())\n ) {\n return component;\n }\n }\n const currentEnv = await this.envs.calculateEnvIdFromExtensions(component.extensions);\n const currentEnvWithoutVersion = currentEnv.split('@')[0];\n if (\n this.options.filterEnvs?.includes(currentEnv) ||\n this.options.filterEnvs?.includes(currentEnvWithoutVersion)\n ) {\n return component;\n }\n return undefined;\n });\n const filtered = compact(await Promise.all(filteredP));\n return filtered;\n }\n\n private 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 pMapPool(\n components,\n async (component) => {\n const fromWorkspace = this.workspace.getIdIfExist(component.id);\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false, fromWorkspace);\n this.divergeData.push(modelComponent);\n },\n { concurrency: concurrentComponentsLimit() }\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 throwForComponentsFromAnotherLane(bitIds: ComponentID[]) {\n if (this.options.objectsOnly) return;\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentRemoteLane = this.remoteLane?.toLaneId().isEqual(currentLaneId) ? this.remoteLane : undefined;\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idsFromAnotherLane: ComponentID[] = [];\n const concurrency = concurrentComponentsLimit();\n if (currentRemoteLane) {\n await pMapPool(\n bitIds,\n async (bitId) => {\n const isOnCurrentLane =\n (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentRemoteLane)) ||\n (currentLane && (await this.scope.isPartOfLaneHistoryOrMain(bitId, currentLane)));\n if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);\n },\n { concurrency }\n );\n } else {\n await pMapPool(\n bitIds,\n async (bitId) => {\n const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);\n if (!isIdOnMain) idsFromAnotherLane.push(bitId);\n },\n { concurrency }\n );\n }\n if (idsFromAnotherLane.length) {\n throw new BitError(`unable to import the following component(s) as they belong to other lane(s):\n${idsFromAnotherLane.map((id) => id.toString()).join(', ')}\nif you need this specific snap, find the lane this snap is belong to, then run \"bit lane merge <lane-id> [component-id]\" to merge this component from the lane.\nif you just want to get a quick look into this snap, create a new workspace and import it by running \"bit lane import <lane-id> --pattern <component-id>\"`);\n }\n }\n\n private async _importComponentsObjects(\n ids: ComponentIdList,\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.importWithoutDeps(ids.toVersionLatest(), {\n cache: false,\n lane,\n includeVersionHistory: true,\n fetchHeadIfLocalIsBehind: !this.options.allHistory,\n collectParents: this.options.allHistory,\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 includeUnexported: this.options.isLaneFromRemote,\n reason: `of their latest on ${lane ? `lane ${lane.id()}` : 'main'}`,\n });\n\n this.logger.setStatusLine(`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 lane,\n preferDependencyGraph: !this.options.fetchDeps,\n // 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 reFetchUnBuiltVersion: true,\n // it's possible that .bitmap is not in sync and has local tags that don't exist on the remote. later, we\n // add them to \"missingIds\" of \"importResult\" and show them to the user\n throwForSeederNotFound: false,\n reason: this.options.fetchDeps\n ? 'for getting all dependencies'\n : `for getting dependencies of components that don't have dependency-graph`,\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. by default, imports from both lane and main (lane versions preferred).\n * if --lane-only flag is specified, import only components that exist 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<ComponentID[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const remoteLaneIds = this.remoteLane?.toComponentIds() || new ComponentIdList();\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !remoteLaneIds.has(id));\n remoteLaneIds.push(...bitMapIdsToImport);\n\n return remoteLaneIds;\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 = await Promise.all(\n idsWithoutWildcard.map(async (idStr) => {\n const id = await this.getIdFromStr(idStr);\n const fromLane = remoteLaneIds.searchWithoutVersion(id);\n return fromLane && !id.hasVersion() ? fromLane : id;\n })\n );\n\n const bitIds: ComponentID[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const existingOnLanes = await this.workspace.filterIdsFromPoolIdsByPattern(idStr, remoteLaneIds, false);\n\n if (this.options.laneOnly) {\n // When --lane-only is specified, import only components that exist on the lane, never from main\n bitIds.push(...existingOnLanes);\n } else {\n // New default behavior: Import from both lane and main\n // Get all components matching the pattern from main\n const idsFromRemote = await this.lister.getRemoteCompIdsByWildcards(idStr, this.options.includeDeprecated);\n\n // Prefer lane versions where they exist, use main versions for the rest\n const laneIds = new Set(existingOnLanes.map((id) => id.toStringWithoutVersion()));\n const mainOnlyIds = idsFromRemote.filter((id) => !laneIds.has(id.toStringWithoutVersion()));\n\n bitIds.push(...existingOnLanes, ...mainOnlyIds);\n }\n });\n\n return bitIds;\n }\n\n private async getIdFromStr(id: string): Promise<ComponentID> {\n if (id.startsWith('@')) return this.workspace.resolveComponentIdFromPackageName(id);\n return ComponentID.fromString(id); // we don't support importing without a scope name\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: ComponentID[] = [];\n\n await pMapPool(\n this.options.ids,\n async (idStr: string) => {\n if (hasWildcard(idStr)) {\n let ids: ComponentID[] = [];\n try {\n ids = await this.lister.getRemoteCompIdsByWildcards(idStr, this.options.includeDeprecated);\n } catch (err: any) {\n if (err instanceof NoIdMatchWildcard) {\n this.logger.consoleWarning(err.message);\n } else {\n this.logger.error(`failed getting the list of components by the wildcard ${idStr}`);\n throw err;\n }\n }\n bitIds.push(...ids);\n } else {\n const id = await this.getIdFromStr(idStr);\n bitIds.push(id);\n }\n },\n { concurrency: 30 }\n );\n\n this.logger.setStatusLine(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<ComponentIdList> {\n const bitIds: ComponentID[] = this.options.lanes\n ? await this.getBitIdsForLanes()\n : await this.getBitIdsForNonLanes();\n const shouldImportDependents =\n this.options.importDependents || this.options.dependentsVia || this.options.dependentsAll;\n const shouldImportDependencies =\n this.options.importDependenciesDirectly || this.options.importHeadDependenciesDirectly;\n if (shouldImportDependencies || shouldImportDependents) {\n if (shouldImportDependencies) {\n const dependenciesIds = await this.getFlattenedDepsUnique(bitIds);\n bitIds.push(...dependenciesIds);\n }\n if (shouldImportDependents) {\n const dependentsGetter = new DependentsGetter(this.logger, this.workspace, this.graph, this.options);\n const dependents = await dependentsGetter.getDependents(bitIds);\n bitIds.push(...dependents);\n }\n }\n return ComponentIdList.uniqFromArray(bitIds);\n }\n\n private async getFlattenedDepsUnique(bitIds: ComponentID[]): Promise<ComponentID[]> {\n const remoteComps = await this.scope.scopeImporter.getManyRemoteComponents(bitIds);\n const versions = remoteComps.getVersions();\n const getFlattened = (): ComponentIdList => {\n if (versions.length === 1) return versions[0].flattenedDependencies;\n const flattenedDeps = versions.map((v) => v.flattenedDependencies).flat();\n return ComponentIdList.uniqFromArray(flattenedDeps);\n };\n const flattened = getFlattened();\n return this.options.importHeadDependenciesDirectly\n ? this.uniqWithoutVersions(flattened)\n : this.removeMultipleVersionsKeepLatest(flattened);\n }\n\n private uniqWithoutVersions(flattened: ComponentIdList) {\n const latest = flattened.toVersionLatest();\n return ComponentIdList.uniqFromArray(latest);\n }\n\n private removeMultipleVersionsKeepLatest(flattened: ComponentIdList): ComponentID[] {\n const grouped = flattened.toGroupByIdWithoutVersion();\n const latestVersions = Object.keys(grouped).map((key) => {\n const ids = grouped[key];\n if (ids.length === 1) return ids[0];\n try {\n const latest = getLatestVersionNumber(ids, ids[0].changeVersion(LATEST_VERSION));\n return latest;\n } catch (err: any) {\n throw new Error(`a dependency \"${key}\" was found with multiple versions, unable to find which one of them is newer.\nerror: ${err.message}\nconsider running with \"--dependencies-head\" flag instead, which checks out to the head of the dependencies`);\n }\n });\n\n return latestVersions;\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 (!componentsIdsToImport.length) {\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 const flagUsed = this.options.merge ? '--merge' : '--override';\n throw new Error(`bit import with no ids and ${flagUsed} flag is not supported.\nto write the components from .bitmap file according to the their remote, please use \"bit checkout reset --all\"`);\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 return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n private getIdsToImportFromBitmap() {\n const allIds = this.consumer.bitMap.getAllBitIdsFromAllLanes();\n return ComponentIdList.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: ComponentIdList): 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 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 // Bounded concurrency: each entry does `isDeprecated` / `isRemoved`, which load and\n // parse the head Version object from disk. Fanning out 4k+ of those at once (the old\n // Promise.all) OOMs the heap on large imports.\n const importDetails = await pMapPool(\n components,\n async (component): Promise<ImportDetails> => {\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(\n currentVersions\n ).join(', ')}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new BitError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = 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 = Boolean(await modelComponent.isDeprecated(this.scope.objects, id.version));\n const removed = Boolean(await component.component.component.isRemoved(this.scope.objects, id.version));\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 { concurrency: concurrentComponentsLimit() }\n );\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: ComponentIdList): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: ComponentIdList): 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 || this.options.trackOnly) return;\n const componentsStatuses = await this.workspace.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 BitError(\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 * 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: ComponentIdList): void {\n ids.forEach((id: ComponentID) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new BitError(`unable to import ${id.toString()}. the component name conflicted with your local (new/staged) component with the same name.\nit's fine to have components with the same name as long as their scope names are different.\nif the component was created by mistake, remove it and import the remote one.\notherwise, if tagged/snapped, \"bit reset\" it, then bit rename it.`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.workspace.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.getComponentId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(component.id.version, this.consumer.scope.objects);\n const mergeResults = await threeWayMerge({\n scope: this.consumer.scope,\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 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 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 return compact(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 = this.remoteLane?.toComponentIds() || new ComponentIdList();\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.setOnLanesOnly(comp.id, 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, { laneHistoryMsg: 'import components' });\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n skipWriteConfigFiles: !this.options.writeConfigFiles,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n shouldUpdateWorkspaceConfig: true,\n reasonForBitmapChange: 'import',\n writeDeps: this.options.writeDeps,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK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A,GAAAkC,gBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.955/dist/importer.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.955/dist/importer.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.957/dist/importer.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_importer@1.0.957/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": "1.0.955",
3
+ "version": "1.0.957",
4
4
  "homepage": "https://bit.cloud/teambit/scope/importer",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.scope",
8
8
  "name": "importer",
9
- "version": "1.0.955"
9
+ "version": "1.0.957"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -16,33 +16,34 @@
16
16
  "p-map-series": "2.1.0",
17
17
  "@teambit/bit-error": "0.0.404",
18
18
  "@teambit/component-id": "1.2.4",
19
+ "@teambit/logger": "0.0.1411",
20
+ "@teambit/cli": "0.0.1318",
21
+ "@teambit/component.modules.merge-helper": "0.0.52",
19
22
  "@teambit/component-version": "1.0.4",
23
+ "@teambit/harmony.modules.concurrency": "0.0.27",
20
24
  "@teambit/lane-id": "0.0.312",
25
+ "@teambit/legacy.consumer-component": "0.0.110",
26
+ "@teambit/legacy.consumer": "0.0.109",
27
+ "@teambit/legacy.scope": "0.0.109",
21
28
  "@teambit/legacy.utils": "0.0.34",
22
29
  "@teambit/toolbox.promise.map-pool": "0.0.14",
23
30
  "@teambit/harmony": "0.4.7",
31
+ "@teambit/component.sources": "0.0.161",
24
32
  "@teambit/legacy-bit-id": "1.1.3",
25
33
  "@teambit/legacy.analytics": "0.0.90",
26
- "@teambit/graph": "1.0.955",
27
- "@teambit/logger": "0.0.1410",
28
- "@teambit/workspace": "1.0.955",
29
- "@teambit/cli": "0.0.1317",
30
- "@teambit/component.modules.merge-helper": "0.0.51",
31
- "@teambit/component-writer": "1.0.955",
32
- "@teambit/config-merger": "0.0.822",
33
- "@teambit/envs": "1.0.955",
34
- "@teambit/legacy.consumer-component": "0.0.109",
35
- "@teambit/legacy.consumer": "0.0.108",
36
- "@teambit/legacy.scope": "0.0.108",
37
- "@teambit/lister": "1.0.955",
38
- "@teambit/objects": "0.0.462",
39
- "@teambit/component.sources": "0.0.160",
40
- "@teambit/dependency-resolver": "1.0.955",
41
- "@teambit/install": "1.0.955",
42
- "@teambit/legacy.scope-api": "0.0.163",
43
- "@teambit/pkg.modules.component-package-name": "0.0.115",
44
- "@teambit/scope.remotes": "0.0.108",
45
- "@teambit/scope": "1.0.955"
34
+ "@teambit/legacy.scope-api": "0.0.164",
35
+ "@teambit/pkg.modules.component-package-name": "0.0.116",
36
+ "@teambit/scope.remotes": "0.0.109",
37
+ "@teambit/graph": "1.0.957",
38
+ "@teambit/workspace": "1.0.957",
39
+ "@teambit/component-writer": "1.0.957",
40
+ "@teambit/config-merger": "0.0.824",
41
+ "@teambit/envs": "1.0.957",
42
+ "@teambit/lister": "1.0.957",
43
+ "@teambit/objects": "0.0.464",
44
+ "@teambit/dependency-resolver": "1.0.957",
45
+ "@teambit/install": "1.0.957",
46
+ "@teambit/scope": "1.0.957"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@types/lodash": "4.14.165",