@teambit/importer 0.0.481 → 0.0.482

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.
@@ -81,6 +81,7 @@ export default class ImportComponents {
81
81
  importSpecificComponents(): Promise<ImportResult>;
82
82
  _fetchDivergeData(components: Component[]): Promise<void>;
83
83
  _throwForDivergedHistory(): void;
84
+ private throwForComponentsFromAnotherLane;
84
85
  private _importComponentsObjects;
85
86
  /**
86
87
  * consider the following use cases:
@@ -247,6 +247,7 @@ class ImportComponents {
247
247
  const components = await (0, _versionDependencies().multipleVersionDependenciesToConsumer)(versionDependenciesArr, this.scope.objects);
248
248
  await this._fetchDivergeData(components);
249
249
  this._throwForDivergedHistory();
250
+ await this.throwForComponentsFromAnotherLane(components.map(c => c.id));
250
251
  componentWriterResults = await this._writeToFileSystem(components);
251
252
  await this._saveLaneDataIfNeeded(components);
252
253
  writtenComponents = components;
@@ -277,6 +278,31 @@ class ImportComponents {
277
278
  throw new (_componentsPendingMerge().default)(divergeData);
278
279
  }
279
280
  }
281
+ async throwForComponentsFromAnotherLane(bitIds) {
282
+ var _this$options$lanes;
283
+ if (this.options.objectsOnly) return;
284
+ const currentLaneId = this.workspace.getCurrentLaneId();
285
+ const currentRemoteLane = currentLaneId ? (_this$options$lanes = this.options.lanes) === null || _this$options$lanes === void 0 ? void 0 : _this$options$lanes.lanes.find(l => l.toLaneId().isEqual(currentLaneId)) : undefined;
286
+ const currentLane = await this.workspace.getCurrentLaneObject();
287
+ const idsFromAnotherLane = [];
288
+ if (currentRemoteLane) {
289
+ await Promise.all(bitIds.map(async bitId => {
290
+ const isOnCurrentLane = (await this.scope.isPartOfLaneHistory(bitId, currentRemoteLane)) || currentLane && (await this.scope.isPartOfLaneHistory(bitId, currentLane)) || (await this.scope.isPartOfMainHistory(bitId));
291
+ if (!isOnCurrentLane) idsFromAnotherLane.push(bitId);
292
+ }));
293
+ } else {
294
+ await Promise.all(bitIds.map(async bitId => {
295
+ const isIdOnMain = await this.scope.isPartOfMainHistory(bitId);
296
+ if (!isIdOnMain) idsFromAnotherLane.push(bitId);
297
+ }));
298
+ }
299
+ if (idsFromAnotherLane.length) {
300
+ throw new (_bitError().BitError)(`unable to import the following component(s) as they belong to other lane(s):
301
+ ${idsFromAnotherLane.map(id => id.toString()).join(', ')}
302
+ if 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.
303
+ `);
304
+ }
305
+ }
280
306
  async _importComponentsObjects(ids, {
281
307
  fromOriginalScope = false,
282
308
  lane,
@@ -333,7 +359,7 @@ class ImportComponents {
333
359
  const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map(idStr => {
334
360
  const id = _bitId().BitId.parse(idStr, true);
335
361
  const fromLane = bitIdsFromLane.searchWithoutVersion(id);
336
- return fromLane || id;
362
+ return fromLane && !id.hasVersion() ? fromLane : id;
337
363
  });
338
364
  const bitIds = [...idsWithoutWildcardPreferFromLane];
339
365
  if (!idsWithWildcard) {
@@ -1 +1 @@
1
- {"version":3,"names":["ImportComponents","constructor","workspace","graph","componentWriter","options","consumer","scope","laneObjects","lanes","importComponents","result","loader","start","BEFORE_IMPORT_ACTION","startTime","process","hrtime","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","succeed","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","map","Promise","all","mergedLane","saveLane","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","Object","keys","importedComps","c","component","toStringWithoutVersion","forEach","compIdStr","found","includes","push","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","join","_throwForPotentialIssues","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","_writeToFileSystem","_saveLaneDataIfNeeded","modelComponent","getModelComponent","setDivergeData","divergeData","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","allHistory","collectParents","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","bitIdsFromLane","BitIds","fromArray","flatMap","toBitIds","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","has","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","hasWithoutVersion","BitError","l","name","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraphIds","targetCompIds","resolveMultipleComponentIds","sourceIds","listIds","findIdsFromSourcesToTargets","_legacy","uniqFromArray","dependencies","bitId","componentGraph","find","scopeName","dependenciesInfo","getDependenciesInfo","d","R","flatten","_getDependentsFromGraph","dependents","dependentsInfo","getDependentsInfo","remotes","getScopeRemotes","scopeGraphs","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","isEmpty","_throwForModifiedOrNewComponents","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","changeVersion","listVersions","versions","fromPairs","currentVersions","detailsP","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","trackOnly","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","GeneralError","chalk","yellow","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","currentLane","getCurrentLaneObject","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","verbose","throwForExistingDir","skipWritingToFs","writeMany"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { FilesStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults, ManyComponentsWriterParams } from '@teambit/component-writer';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n objectsOnly?: boolean;\n saveDependenciesAsComponents?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages or nested, not as imported\n importDependents?: boolean;\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneIds: LaneId[];\n lanes: Lane[]; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n trackOnly?: boolean;\n};\ntype ComponentMergeStatus = {\n component: Component;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private laneObjects: Lane[];\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n loader.start(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n loader.succeed(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n loader.succeed(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n loader.succeed(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 if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n 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 missingIds,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n componentWriterResults = await this._writeToFileSystem(components);\n await this._saveLaneDataIfNeeded(components);\n writtenComponents = components;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n async _fetchDivergeData(components: Component[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n components.map(async (component) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids,\n fromHead: this.options.allHistory,\n collectParents: this.options.allHistory,\n lane,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n });\n loader.start(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lanes: lane ? [lane] : undefined,\n preferDependencyGraph: !this.options.fetchDeps,\n // 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 });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !bitIdsFromLane.has(id));\n bitIdsFromLane.push(...bitMapIdsToImport);\n\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane || id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraphIds();\n const targetCompIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const sourceIds = await this.workspace.listIds();\n const ids = graph.findIdsFromSourcesToTargets(sourceIds, targetCompIds);\n logger.debug(\n `found ${ids.length} component for --dependents flag`,\n ids.map((id) => id.toString())\n );\n bitIds.push(...ids.map((id) => id._legacy));\n }\n }\n return BitIds.uniqFromArray(bitIds);\n }\n\n _getDependenciesFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependencies = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependenciesInfo = componentGraph.getDependenciesInfo(bitId);\n return dependenciesInfo.map((d) => d.id);\n });\n return R.flatten(dependencies);\n }\n\n _getDependentsFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependents = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependentsInfo = componentGraph.getDependentsInfo(bitId);\n return dependentsInfo.map((d) => d.id);\n });\n return R.flatten(dependents);\n }\n\n async _getComponentsGraphs(bitIds: BitId[]): Promise<DependencyGraph[]> {\n const remotes: Remotes = await getScopeRemotes(this.consumer.scope);\n return remotes.scopeGraphs(bitIds, this.consumer.scope);\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (R.isEmpty(componentsIdsToImport)) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n throw new Error(`bit import with no ids and --merge flag was not implemented yet`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n componentWriterResults = await this._writeToFileSystem(components);\n writtenComponents = components;\n }\n\n 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 BitIds.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: BitIds): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return R.fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new ShowDoctorError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = R.difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = await modelComponent.isDeprecated(this.scope.objects);\n const removed = await component.component.component.isRemoved(this.scope.objects);\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n const importDetails: ImportDetails[] = await Promise.all(detailsP);\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge || this.options.trackOnly) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { component, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]> {\n if (!this.options.merge) return components;\n const componentsStatusP = components.map((component: Component) => {\n return this._getMergeStatus(component);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const component = componentStatus.component;\n if (!filesStatus) return component;\n this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return component;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(components: Component[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA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,KAAK,CAAC;QACpE;MACF;MACA,MAAMkD,cAAc,GAAG,MAAM,IAAI,CAAC9E,KAAK,CAAC+E,iBAAiB,CAACyL,IAAI,CAAC5O,EAAE,CAAC;MAClE,MAAMgP,GAAG,GAAG9L,cAAc,CAAC+L,MAAM,CAACL,IAAI,CAAC5O,EAAE,CAACmM,OAAO,CAAW;MAC5D,IAAI,CAAC6C,GAAG,EAAE,MAAM,IAAIvP,KAAK,CAAE,+CAA8CmP,IAAI,CAAC5O,EAAE,CAACC,QAAQ,EAAG,EAAC,CAAC;MAC9FwO,WAAW,CAACS,YAAY,CAAC;QAAElP,EAAE,EAAE4O,IAAI,CAAC5O,EAAE;QAAEmP,IAAI,EAAEH;MAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CACH;IACD,MAAM,IAAI,CAAC5Q,KAAK,CAACE,KAAK,CAAC0C,QAAQ,CAACyN,WAAW,CAAC;EAC9C;EAEA,MAAMzL,kBAAkB,CAACL,UAAuB,EAAmC;IACjF,MAAMuL,iBAAiB,GAAG,MAAM,IAAI,CAACL,2CAA2C,CAAClL,UAAU,CAAC;IAC5F,MAAMyM,wBAAoD,GAAG;MAC3DzM,UAAU,EAAEuL,iBAAiB;MAC7BmB,WAAW,EAAE,IAAI,CAACnR,OAAO,CAACmR,WAAW;MACrCC,WAAW,EAAE,IAAI,CAACpR,OAAO,CAACoR,WAAW;MACrCC,0BAA0B,EAAE,CAAC,IAAI,CAACrR,OAAO,CAACsR,kBAAkB;MAC5DC,OAAO,EAAE,IAAI,CAACvR,OAAO,CAACuR,OAAO;MAC7BC,mBAAmB,EAAE,CAAC,IAAI,CAACxR,OAAO,CAAC0K,QAAQ;MAC3C+G,eAAe,EAAE,IAAI,CAACzR,OAAO,CAAC2M;IAChC,CAAC;IACD,OAAO,IAAI,CAAC5M,eAAe,CAAC2R,SAAS,CAACR,wBAAwB,CAAC;EACjE;AACF;AAAC"}
1
+ {"version":3,"names":["ImportComponents","constructor","workspace","graph","componentWriter","options","consumer","scope","laneObjects","lanes","importComponents","result","loader","start","BEFORE_IMPORT_ACTION","startTime","process","hrtime","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","succeed","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","map","Promise","all","mergedLane","saveLane","returnCompleteResults","writtenComponents","componentWriterResults","importDetails","_getImportDetails","missingIds","Object","keys","importedComps","c","component","toStringWithoutVersion","forEach","compIdStr","found","includes","push","importedIds","v","flat","importedDeps","allDependenciesIds","installationError","compilationError","join","_throwForPotentialIssues","components","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","throwForComponentsFromAnotherLane","_writeToFileSystem","_saveLaneDataIfNeeded","modelComponent","getModelComponent","setDivergeData","divergeData","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnSourceOnly","snapsRemote","snapsOnTargetOnly","ComponentsPendingMerge","currentLaneId","getCurrentLaneId","currentRemoteLane","find","l","toLaneId","isEqual","currentLane","getCurrentLaneObject","idsFromAnotherLane","bitId","isOnCurrentLane","isPartOfLaneHistory","isPartOfMainHistory","isIdOnMain","BitError","fromOriginalScope","ignoreMissingHead","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","allHistory","collectParents","results","importManyFromOriginalScopes","importMany","preferDependencyGraph","fetchDeps","reFetchUnBuiltVersion","throwForSeederNotFound","getBitIdsForLanes","bitIdsFromLane","BitIds","fromArray","flatMap","toBitIds","bitMapIds","bitMap","getAllBitIds","bitMapIdsToImport","hasScope","has","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","hasVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","hasWithoutVersion","name","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraphIds","targetCompIds","resolveMultipleComponentIds","sourceIds","listIds","findIdsFromSourcesToTargets","_legacy","uniqFromArray","dependencies","componentGraph","scopeName","dependenciesInfo","getDependenciesInfo","d","R","flatten","_getDependentsFromGraph","dependents","dependentsInfo","getDependentsInfo","remotes","getScopeRemotes","scopeGraphs","override","componentsIdsToImport","getIdsToImportFromBitmap","emptyResult","isEmpty","_throwForModifiedOrNewComponents","allIds","getAllBitIdsFromAllLanes","versionsP","getModelComponentIfExist","changeVersion","listVersions","versions","fromPairs","currentVersions","detailsP","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","getHeadRegardlessOfLaneAsTagOrHash","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","trackOnly","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","GeneralError","chalk","yellow","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","idsFromRemoteLanes","comp","existOnRemoteLane","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriterOpts","writeToPath","writeConfig","skipDependencyInstallation","installNpmPackages","verbose","throwForExistingDir","skipWritingToFs","writeMany"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n threeWayMerge,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { FilesStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport ComponentsPendingMerge from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-merge';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport VersionDependencies, {\n multipleVersionDependenciesToConsumer,\n} from '@teambit/legacy/dist/scope/version-dependencies';\nimport { GraphMain } from '@teambit/graph';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentWriterMain, ComponentWriterResults, ManyComponentsWriterParams } from '@teambit/component-writer';\n\nexport type ImportOptions = {\n ids: string[]; // array might be empty\n verbose?: boolean;\n merge?: boolean;\n mergeStrategy?: MergeStrategy;\n writeToPath?: string;\n writeConfig?: boolean;\n override?: boolean;\n installNpmPackages: boolean; // default: true\n objectsOnly?: boolean;\n saveDependenciesAsComponents?: boolean;\n importDependenciesDirectly?: boolean; // default: false, normally it imports them as packages or nested, not as imported\n importDependents?: boolean;\n fromOriginalScope?: boolean; // default: false, otherwise, it fetches flattened dependencies from their dependents\n saveInLane?: boolean; // save the imported component on the current lane (won't be available on main)\n lanes?: {\n laneIds: LaneId[];\n lanes: Lane[]; // it can be an empty array when a lane is a local lane and doesn't exist on the remote\n };\n allHistory?: boolean;\n fetchDeps?: boolean; // by default, if a component was tagged with > 0.0.900, it has the flattened-deps-graph in the object\n trackOnly?: boolean;\n};\ntype ComponentMergeStatus = {\n component: Component;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n installationError?: Error;\n compilationError?: Error;\n missingIds?: string[]; // in case the import is configured to not throw when missing\n};\n\nexport default class ImportComponents {\n consumer: Consumer;\n scope: Scope;\n mergeStatus: { [id: string]: FilesStatus };\n private laneObjects: Lane[];\n private divergeData: Array<ModelComponent> = [];\n constructor(\n private workspace: Workspace,\n private graph: GraphMain,\n private componentWriter: ComponentWriterMain,\n public options: ImportOptions\n ) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n async importComponents(): Promise<ImportResult> {\n let result;\n loader.start(BEFORE_IMPORT_ACTION);\n const startTime = process.hrtime();\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n result = await this.importObjectsOnLane();\n loader.succeed(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n if (this.options.ids.length) {\n result = await this.importSpecificComponents();\n loader.succeed(BEFORE_IMPORT_ACTION, startTime);\n return result;\n }\n result = await this.importAccordingToBitMap();\n loader.succeed(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 if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane,\n });\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n 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 missingIds,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n await this._fetchDivergeData(components);\n this._throwForDivergedHistory();\n await this.throwForComponentsFromAnotherLane(components.map((c) => c.id));\n componentWriterResults = await this._writeToFileSystem(components);\n await this._saveLaneDataIfNeeded(components);\n writtenComponents = components;\n }\n\n return this.returnCompleteResults(\n beforeImportVersions,\n versionDependenciesArr,\n writtenComponents,\n componentWriterResults\n );\n }\n\n async _fetchDivergeData(components: Component[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n components.map(async (component) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnSourceOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnTargetOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async throwForComponentsFromAnotherLane(bitIds: BitId[]) {\n if (this.options.objectsOnly) return;\n const currentLaneId = this.workspace.getCurrentLaneId();\n const currentRemoteLane = currentLaneId\n ? this.options.lanes?.lanes.find((l) => l.toLaneId().isEqual(currentLaneId))\n : undefined;\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idsFromAnotherLane: BitId[] = [];\n if (currentRemoteLane) {\n await Promise.all(\n bitIds.map(async (bitId) => {\n const isOnCurrentLane =\n (await this.scope.isPartOfLaneHistory(bitId, currentRemoteLane)) ||\n (currentLane && (await this.scope.isPartOfLaneHistory(bitId, currentLane))) ||\n (await this.scope.isPartOfMainHistory(bitId));\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.\n`);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids,\n fromHead: this.options.allHistory,\n collectParents: this.options.allHistory,\n lane,\n // in case a user is merging a lane into a new workspace, then, locally main has head, but remotely the head is\n // empty, until it's exported. going to the remote and asking this component will throw an error if ignoreMissingHead is false\n ignoreMissingHead: true,\n });\n loader.start(`import ${ids.length} components with their dependencies (if missing)`);\n const results = fromOriginalScope\n ? await scopeComponentsImporter.importManyFromOriginalScopes(ids)\n : await scopeComponentsImporter.importMany({\n ids,\n ignoreMissingHead,\n lanes: lane ? [lane] : undefined,\n preferDependencyGraph: !this.options.fetchDeps,\n // 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 });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const bitMapIds = this.consumer.bitMap.getAllBitIds();\n const bitMapIdsToImport = bitMapIds.filter((id) => id.hasScope() && !bitIdsFromLane.has(id));\n bitIdsFromLane.push(...bitMapIdsToImport);\n\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane && !id.hasVersion() ? fromLane : id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraphIds();\n const targetCompIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const sourceIds = await this.workspace.listIds();\n const ids = graph.findIdsFromSourcesToTargets(sourceIds, targetCompIds);\n logger.debug(\n `found ${ids.length} component for --dependents flag`,\n ids.map((id) => id.toString())\n );\n bitIds.push(...ids.map((id) => id._legacy));\n }\n }\n return BitIds.uniqFromArray(bitIds);\n }\n\n _getDependenciesFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependencies = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependenciesInfo = componentGraph.getDependenciesInfo(bitId);\n return dependenciesInfo.map((d) => d.id);\n });\n return R.flatten(dependencies);\n }\n\n _getDependentsFromGraph(bitIds: BitId[], graphs: DependencyGraph[]): BitId[] {\n const dependents = bitIds.map((bitId) => {\n const componentGraph = graphs.find((graph) => graph.scopeName === bitId.scope);\n if (!componentGraph) {\n throw new Error(`unable to find a graph for ${bitId.toString()}`);\n }\n const dependentsInfo = componentGraph.getDependentsInfo(bitId);\n return dependentsInfo.map((d) => d.id);\n });\n return R.flatten(dependents);\n }\n\n async _getComponentsGraphs(bitIds: BitId[]): Promise<DependencyGraph[]> {\n const remotes: Remotes = await getScopeRemotes(this.consumer.scope);\n return remotes.scopeGraphs(bitIds, this.consumer.scope);\n }\n\n async importAccordingToBitMap(): Promise<ImportResult> {\n this.options.objectsOnly = !this.options.merge && !this.options.override;\n const componentsIdsToImport = this.getIdsToImportFromBitmap();\n const emptyResult = {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\n if (R.isEmpty(componentsIdsToImport)) {\n return emptyResult;\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return emptyResult;\n }\n if (!this.options.objectsOnly) {\n throw new Error(`bit import with no ids and --merge flag was not implemented yet`);\n }\n const versionDependenciesArr = await this._importComponentsObjects(componentsIdsToImport, {\n fromOriginalScope: this.options.fromOriginalScope,\n });\n let writtenComponents: Component[] = [];\n let componentWriterResults: ComponentWriterResults | undefined;\n if (!this.options.objectsOnly) {\n const components = await multipleVersionDependenciesToConsumer(versionDependenciesArr, this.scope.objects);\n componentWriterResults = await this._writeToFileSystem(components);\n writtenComponents = components;\n }\n\n 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 BitIds.fromArray(allIds.filter((id) => id.hasScope()));\n }\n\n async _getCurrentVersions(ids: BitIds): Promise<ImportedVersions> {\n const versionsP = ids.map(async (id) => {\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id.changeVersion(undefined));\n const idStr = id.toStringWithoutVersion();\n if (!modelComponent) return [idStr, []];\n return [idStr, modelComponent.listVersions()];\n });\n const versions = await Promise.all(versionsP);\n return R.fromPairs(versions);\n }\n\n /**\n * get import details, includes the diff between the versions array before import and after import\n */\n async _getImportDetails(\n currentVersions: ImportedVersions,\n components: VersionDependencies[]\n ): Promise<ImportDetails[]> {\n const detailsP = components.map(async (component) => {\n const id = component.component.id;\n const idStr = id.toStringWithoutVersion();\n const beforeImportVersions = currentVersions[idStr];\n if (!beforeImportVersions) {\n throw new Error(\n `_getImportDetails failed finding ${idStr} in currentVersions, which has ${Object.keys(currentVersions).join(\n ', '\n )}`\n );\n }\n const modelComponent = await this.consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new ShowDoctorError(`imported component ${idStr} was not found in the model`);\n const afterImportVersions = modelComponent.listVersions();\n const versionDifference: string[] = R.difference(afterImportVersions, beforeImportVersions);\n const getStatus = (): ImportStatus => {\n if (!versionDifference.length) return 'up to date';\n if (!beforeImportVersions.length) return 'added';\n return 'updated';\n };\n const filesStatus = this.mergeStatus && this.mergeStatus[idStr] ? this.mergeStatus[idStr] : null;\n const deprecated = await modelComponent.isDeprecated(this.scope.objects);\n const removed = await component.component.component.isRemoved(this.scope.objects);\n const latestVersion = modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: this.options.fetchDeps ? component.getMissingDependencies() : [],\n deprecated,\n removed,\n };\n });\n const importDetails: ImportDetails[] = await Promise.all(detailsP);\n\n return importDetails;\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge || this.options.trackOnly) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(component: Component): Promise<ComponentMergeStatus> {\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { component, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(components: Component[]): Promise<Component[]> {\n if (!this.options.merge) return components;\n const componentsStatusP = components.map((component: Component) => {\n return this._getMergeStatus(component);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const component = componentStatus.component;\n if (!filesStatus) return component;\n this.mergeStatus[component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return component;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(components: Component[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(components: Component[]): Promise<ComponentWriterResults> {\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(components);\n const manyComponentsWriterOpts: ManyComponentsWriterParams = {\n components: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n skipDependencyInstallation: !this.options.installNpmPackages,\n verbose: this.options.verbose,\n throwForExistingDir: !this.options.override,\n skipWritingToFs: this.options.trackOnly,\n };\n return this.componentWriter.writeMany(manyComponentsWriterOpts);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EA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K,CAAC0C,QAAQ,CAACwD,WAAW,CAAC;EAC9C;EAEA,MAAMvB,kBAAkB,CAACN,UAAuB,EAAmC;IACjF,MAAMqM,iBAAiB,GAAG,MAAM,IAAI,CAACL,2CAA2C,CAAChM,UAAU,CAAC;IAC5F,MAAMqN,wBAAoD,GAAG;MAC3DrN,UAAU,EAAEqM,iBAAiB;MAC7BiB,WAAW,EAAE,IAAI,CAAC/R,OAAO,CAAC+R,WAAW;MACrCC,WAAW,EAAE,IAAI,CAAChS,OAAO,CAACgS,WAAW;MACrCC,0BAA0B,EAAE,CAAC,IAAI,CAACjS,OAAO,CAACkS,kBAAkB;MAC5DC,OAAO,EAAE,IAAI,CAACnS,OAAO,CAACmS,OAAO;MAC7BC,mBAAmB,EAAE,CAAC,IAAI,CAACpS,OAAO,CAACwL,QAAQ;MAC3C6G,eAAe,EAAE,IAAI,CAACrS,OAAO,CAACyN;IAChC,CAAC;IACD,OAAO,IAAI,CAAC1N,eAAe,CAACuS,SAAS,CAACR,wBAAwB,CAAC;EACjE;AACF;AAAC"}
@@ -196,7 +196,8 @@ exports.ImportCmd = ImportCmd;
196
196
  function formatMissingComponents(missing) {
197
197
  if (!(missing !== null && missing !== void 0 && missing.length)) return '';
198
198
  const title = _chalk().default.underline('Missing Components');
199
- const subTitle = 'The following components are missing from the remote in the requested version, try running "bit status" to re-sync your .bitmap file';
199
+ const subTitle = `The following components are missing from the remote in the requested version, try running "bit status" to re-sync your .bitmap file
200
+ Also, make sure the requested version exists on main or the checked out lane`;
200
201
  const body = _chalk().default.red(missing.join('\n'));
201
202
  return `\n\n${title}\n${subTitle}\n${body}`;
202
203
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ImportCmd","constructor","importer","name","description","report","ids","path","objects","displayDependencies","override","verbose","json","conf","skipNpmInstall","skipDependencyInstallation","merge","saveInLane","dependencies","dependents","allHistory","fetchDeps","trackOnly","GeneralError","length","console","log","chalk","yellow","mergeStrategy","R","is","String","options","Object","keys","MergeOptions","includes","join","importOptions","Boolean","writeToPath","objectsOnly","writeConfig","installNpmPackages","importDependenciesDirectly","importDependents","importResults","import","_packageManagerArgs","importDetails","importedIds","importedDeps","installationError","compilationError","missingIds","JSON","stringify","cancellationMessage","summaryPrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","upToDateStr","summary","importOutput","compact","green","importedDepsOutput","immutableUnshift","uniq","formatPlainComponentItem","output","formatMissingComponents","installationErrorOutput","compilationErrorOutput","missing","title","underline","subTitle","body","red","getVersionsOutput","versions","latestVersion","usedVersion","version","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","deprecated","removed","missingDeps","d","undefined","dim","cyan"],"sources":["import.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { compact } from 'lodash';\nimport R from 'ramda';\nimport { installationErrorOutput, compilationErrorOutput } from '@teambit/merging';\nimport {\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { immutableUnshift } from '@teambit/legacy/dist/utils';\nimport { formatPlainComponentItem } from '@teambit/legacy/dist/cli/chalk-box';\nimport { ImporterMain } from './importer.main.runtime';\nimport { ImportOptions, ImportDetails, ImportStatus } from './import-components';\n\nexport class ImportCmd implements Command {\n name = 'import [component-patterns...]';\n description = 'import components from their remote scopes to the local workspace';\n helpUrl = 'docs/components/importing-components';\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'component IDs or component patterns (separated by space). Use patterns to import groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription: string;\n group = 'collaborate';\n alias = '';\n options = [\n ['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'],\n [\n 'o',\n 'objects',\n 'import components objects to the local scope without checkout (without writing them to the file system). This is a default behavior for import with no id argument',\n ],\n ['d', 'display-dependencies', 'display the imported dependencies'],\n ['O', 'override', 'override local changes'],\n ['v', 'verbose', 'show verbose output for inspection'],\n ['j', 'json', 'return the output as JSON'],\n // ['', 'conf', 'write the configuration file (component.json) of the component'], // not working. need to fix once ComponentWriter is moved to Harmony\n ['', 'skip-npm-install', 'DEPRECATED. use \"--skip-dependency-installation\" instead'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n [\n 'm',\n 'merge [strategy]',\n 'merge local changes with the imported version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n ['', 'dependencies', 'EXPERIMENTAL. import all dependencies and write them to the workspace'],\n [\n '',\n 'dependents',\n 'EXPERIMENTAL. import components found while traversing from the given ids upwards to the workspace components',\n ],\n [\n '',\n 'save-in-lane',\n 'EXPERIMENTAL. when checked out to a lane and the component is not on the remote-lane, save it in the lane (default to save on main)',\n ],\n [\n '',\n 'all-history',\n 'relevant for fetching all components objects. avoid optimizations, fetch all history versions, always',\n ],\n ['', 'fetch-deps', 'fetch dependencies objects'],\n ['', 'track-only', 'do not write any file, just create .bitmap entries of the imported components'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n _packageManagerArgs: string[]; // gets populated by yargs-adapter.handler().\n\n constructor(private importer: ImporterMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n path,\n objects = false,\n displayDependencies = false,\n override = false,\n verbose = false,\n json = false,\n conf,\n skipNpmInstall = false,\n skipDependencyInstallation = false,\n merge,\n saveInLane = false,\n dependencies = false,\n dependents = false,\n allHistory = false,\n fetchDeps = false,\n trackOnly = false,\n }: {\n path?: string;\n objects?: boolean;\n displayDependencies?: boolean;\n override?: boolean;\n verbose?: boolean;\n json?: boolean;\n conf?: string;\n skipNpmInstall?: boolean;\n skipDependencyInstallation?: boolean;\n merge?: MergeStrategy;\n saveInLane?: boolean;\n dependencies?: boolean;\n dependents?: boolean;\n allHistory?: boolean;\n fetchDeps?: boolean;\n trackOnly?: boolean;\n }\n ): Promise<any> {\n if (objects && merge) {\n throw new GeneralError('you cant use --objects and --merge flags combined');\n }\n if (override && merge) {\n throw new GeneralError('you cant use --override and --merge flags combined');\n }\n if (!ids.length && dependencies) {\n throw new GeneralError('you have to specify ids to use \"--dependencies\" flag');\n }\n if (!ids.length && dependents) {\n throw new GeneralError('you have to specify ids to use \"--dependents\" flag');\n }\n if (!ids.length && trackOnly) {\n throw new GeneralError('you have to specify ids to use \"--track-only\" flag');\n }\n if (skipNpmInstall) {\n // eslint-disable-next-line no-console\n console.log(\n chalk.yellow(`\"--skip-npm-install\" has been deprecated, please use \"--skip-dependency-installation\" instead`)\n );\n skipDependencyInstallation = true;\n }\n let mergeStrategy;\n if (merge && R.is(String, merge)) {\n const options = Object.keys(MergeOptions);\n if (!options.includes(merge)) {\n throw new GeneralError(`merge must be one of the following: ${options.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n\n const importOptions: ImportOptions = {\n ids,\n verbose,\n merge: Boolean(merge),\n mergeStrategy,\n writeToPath: path,\n objectsOnly: objects,\n override,\n writeConfig: Boolean(conf),\n installNpmPackages: !skipDependencyInstallation,\n saveInLane,\n importDependenciesDirectly: dependencies,\n importDependents: dependents,\n allHistory,\n fetchDeps,\n trackOnly,\n };\n const importResults = await this.importer.import(importOptions, this._packageManagerArgs);\n const { importDetails, importedIds, importedDeps, installationError, compilationError, missingIds } = importResults;\n\n if (json) {\n return JSON.stringify({ importDetails, installationError }, null, 4);\n }\n\n if (!importedIds.length && !missingIds?.length) {\n return chalk.yellow(importResults.cancellationMessage || 'nothing to import');\n }\n\n const summaryPrefix =\n importedIds.length === 1\n ? 'successfully imported one component'\n : `successfully imported ${importedIds.length} components`;\n\n let upToDateCount = 0;\n const importedComponents = importedIds.map((bitId) => {\n const details = importDetails.find((c) => c.id === bitId.toStringWithoutVersion());\n if (!details) throw new Error(`missing details of component ${bitId.toString()}`);\n if (details.status === 'up to date') {\n upToDateCount += 1;\n }\n return formatPlainComponentItemWithVersions(bitId, details);\n });\n const upToDateStr = upToDateCount === 0 ? '' : `, ${upToDateCount} components are up to date`;\n const summary = `${summaryPrefix}${upToDateStr}`;\n const importOutput = [...compact(importedComponents), chalk.green(summary)].join('\\n');\n const importedDepsOutput =\n displayDependencies && importedDeps.length\n ? immutableUnshift(\n R.uniq(importedDeps.map(formatPlainComponentItem)),\n chalk.green(`\\n\\nsuccessfully imported ${importedDeps.length} component dependencies`)\n ).join('\\n')\n : '';\n\n const output =\n importOutput +\n importedDepsOutput +\n formatMissingComponents(missingIds) +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError);\n\n return output;\n }\n}\n\nfunction formatMissingComponents(missing?: string[]) {\n if (!missing?.length) return '';\n const title = chalk.underline('Missing Components');\n const subTitle =\n 'The following components are missing from the remote in the requested version, try running \"bit status\" to re-sync your .bitmap file';\n const body = chalk.red(missing.join('\\n'));\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nfunction formatPlainComponentItemWithVersions(bitId: BitId, importDetails: ImportDetails) {\n const status: ImportStatus = importDetails.status;\n const id = bitId.toStringWithoutVersion();\n const getVersionsOutput = () => {\n if (!importDetails.versions.length) return '';\n if (importDetails.latestVersion) {\n return `${importDetails.versions.length} new version(s) available, latest ${importDetails.latestVersion}`;\n }\n return `new versions: ${importDetails.versions.join(', ')}`;\n };\n const versions = getVersionsOutput();\n const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';\n const getConflictMessage = () => {\n if (!importDetails.filesStatus) return '';\n const conflictedFiles = Object.keys(importDetails.filesStatus)\n // @ts-ignore file is set\n .filter((file) => importDetails.filesStatus[file] === FileStatus.manual);\n if (!conflictedFiles.length) return '';\n return `(the following files were saved with conflicts ${conflictedFiles\n .map((file) => chalk.bold(file))\n .join(', ')}) `;\n };\n const conflictMessage = getConflictMessage();\n const deprecated = importDetails.deprecated && !importDetails.removed ? chalk.yellow('deprecated') : '';\n const removed = importDetails.removed ? chalk.red('removed') : '';\n const missingDeps = importDetails.missingDeps.length\n ? chalk.red(`missing dependencies: ${importDetails.missingDeps.map((d) => d.toString()).join(', ')}`)\n : '';\n if (status === 'up to date' && !missingDeps && !deprecated && !conflictMessage && !removed) {\n return undefined;\n }\n return chalk.dim(\n `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,SAAS,CAAoB;EAuDT;;EAE/BC,WAAW,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,8CAxDnC,gCAAgC;IAAA,qDACzB,mEAAmE;IAAA,iDACvE,sCAAsC;IAAA,mDACpC,CACV;MACEC,IAAI,EAAE,uBAAuB;MAC7BC,WAAW,EACT;IACJ,CAAC,CACF;IAAA;IAAA,+CAEO,aAAa;IAAA,+CACb,EAAE;IAAA,iDACA,CACR,CAAC,GAAG,EAAE,aAAa,EAAE,gFAAgF,CAAC,EACtG,CACE,GAAG,EACH,SAAS,EACT,oKAAoK,CACrK,EACD,CAAC,GAAG,EAAE,sBAAsB,EAAE,mCAAmC,CAAC,EAClE,CAAC,GAAG,EAAE,UAAU,EAAE,wBAAwB,CAAC,EAC3C,CAAC,GAAG,EAAE,SAAS,EAAE,oCAAoC,CAAC,EACtD,CAAC,GAAG,EAAE,MAAM,EAAE,2BAA2B,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GAAG,EAAE;EACjE,MAAMiB,WAAW,GAAG1D,aAAa,CAAC0D,WAAW,CAACpF,MAAM,GAChDG,gBAAK,CAACgE,GAAG,CAAE,yBAAwBzC,aAAa,CAAC0D,WAAW,CAAC9C,GAAG,CAAE+C,CAAC,IAAKA,CAAC,CAACvC,QAAQ,EAAE,CAAC,CAAChC,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC,GACnG,EAAE;EACN,IAAIiC,MAAM,KAAK,YAAY,IAAI,CAACqC,WAAW,IAAI,CAACF,UAAU,IAAI,CAACD,eAAe,IAAI,CAACE,OAAO,EAAE;IAC1F,OAAOG,SAAS;EAClB;EACA,OAAOnF,gBAAK,CAACoF,GAAG,CACb,KAAIpF,gBAAK,CAACkD,KAAK,CAACN,MAAM,CAAE,IAAG5C,gBAAK,CAACqF,IAAI,CACpC7C,EAAE,CACF,IAAG0B,QAAS,GAAEE,WAAY,IAAGU,eAAgB,GAAEC,UAAW,GAAEC,OAAQ,IAAGC,WAAY,EAAC,CACvF;AACH"}
1
+ {"version":3,"names":["ImportCmd","constructor","importer","name","description","report","ids","path","objects","displayDependencies","override","verbose","json","conf","skipNpmInstall","skipDependencyInstallation","merge","saveInLane","dependencies","dependents","allHistory","fetchDeps","trackOnly","GeneralError","length","console","log","chalk","yellow","mergeStrategy","R","is","String","options","Object","keys","MergeOptions","includes","join","importOptions","Boolean","writeToPath","objectsOnly","writeConfig","installNpmPackages","importDependenciesDirectly","importDependents","importResults","import","_packageManagerArgs","importDetails","importedIds","importedDeps","installationError","compilationError","missingIds","JSON","stringify","cancellationMessage","summaryPrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","upToDateStr","summary","importOutput","compact","green","importedDepsOutput","immutableUnshift","uniq","formatPlainComponentItem","output","formatMissingComponents","installationErrorOutput","compilationErrorOutput","missing","title","underline","subTitle","body","red","getVersionsOutput","versions","latestVersion","usedVersion","version","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","deprecated","removed","missingDeps","d","undefined","dim","cyan"],"sources":["import.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { compact } from 'lodash';\nimport R from 'ramda';\nimport { installationErrorOutput, compilationErrorOutput } from '@teambit/merging';\nimport {\n FileStatus,\n MergeOptions,\n MergeStrategy,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { immutableUnshift } from '@teambit/legacy/dist/utils';\nimport { formatPlainComponentItem } from '@teambit/legacy/dist/cli/chalk-box';\nimport { ImporterMain } from './importer.main.runtime';\nimport { ImportOptions, ImportDetails, ImportStatus } from './import-components';\n\nexport class ImportCmd implements Command {\n name = 'import [component-patterns...]';\n description = 'import components from their remote scopes to the local workspace';\n helpUrl = 'docs/components/importing-components';\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'component IDs or component patterns (separated by space). Use patterns to import groups of components using a common scope or namespace. E.g., \"utils/*\" (wrap with double quotes)',\n },\n ];\n extendedDescription: string;\n group = 'collaborate';\n alias = '';\n options = [\n ['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'],\n [\n 'o',\n 'objects',\n 'import components objects to the local scope without checkout (without writing them to the file system). This is a default behavior for import with no id argument',\n ],\n ['d', 'display-dependencies', 'display the imported dependencies'],\n ['O', 'override', 'override local changes'],\n ['v', 'verbose', 'show verbose output for inspection'],\n ['j', 'json', 'return the output as JSON'],\n // ['', 'conf', 'write the configuration file (component.json) of the component'], // not working. need to fix once ComponentWriter is moved to Harmony\n ['', 'skip-npm-install', 'DEPRECATED. use \"--skip-dependency-installation\" instead'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n [\n 'm',\n 'merge [strategy]',\n 'merge local changes with the imported version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n ['', 'dependencies', 'EXPERIMENTAL. import all dependencies and write them to the workspace'],\n [\n '',\n 'dependents',\n 'EXPERIMENTAL. import components found while traversing from the given ids upwards to the workspace components',\n ],\n [\n '',\n 'save-in-lane',\n 'EXPERIMENTAL. when checked out to a lane and the component is not on the remote-lane, save it in the lane (default to save on main)',\n ],\n [\n '',\n 'all-history',\n 'relevant for fetching all components objects. avoid optimizations, fetch all history versions, always',\n ],\n ['', 'fetch-deps', 'fetch dependencies objects'],\n ['', 'track-only', 'do not write any file, just create .bitmap entries of the imported components'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n _packageManagerArgs: string[]; // gets populated by yargs-adapter.handler().\n\n constructor(private importer: ImporterMain) {}\n\n async report(\n [ids = []]: [string[]],\n {\n path,\n objects = false,\n displayDependencies = false,\n override = false,\n verbose = false,\n json = false,\n conf,\n skipNpmInstall = false,\n skipDependencyInstallation = false,\n merge,\n saveInLane = false,\n dependencies = false,\n dependents = false,\n allHistory = false,\n fetchDeps = false,\n trackOnly = false,\n }: {\n path?: string;\n objects?: boolean;\n displayDependencies?: boolean;\n override?: boolean;\n verbose?: boolean;\n json?: boolean;\n conf?: string;\n skipNpmInstall?: boolean;\n skipDependencyInstallation?: boolean;\n merge?: MergeStrategy;\n saveInLane?: boolean;\n dependencies?: boolean;\n dependents?: boolean;\n allHistory?: boolean;\n fetchDeps?: boolean;\n trackOnly?: boolean;\n }\n ): Promise<any> {\n if (objects && merge) {\n throw new GeneralError('you cant use --objects and --merge flags combined');\n }\n if (override && merge) {\n throw new GeneralError('you cant use --override and --merge flags combined');\n }\n if (!ids.length && dependencies) {\n throw new GeneralError('you have to specify ids to use \"--dependencies\" flag');\n }\n if (!ids.length && dependents) {\n throw new GeneralError('you have to specify ids to use \"--dependents\" flag');\n }\n if (!ids.length && trackOnly) {\n throw new GeneralError('you have to specify ids to use \"--track-only\" flag');\n }\n if (skipNpmInstall) {\n // eslint-disable-next-line no-console\n console.log(\n chalk.yellow(`\"--skip-npm-install\" has been deprecated, please use \"--skip-dependency-installation\" instead`)\n );\n skipDependencyInstallation = true;\n }\n let mergeStrategy;\n if (merge && R.is(String, merge)) {\n const options = Object.keys(MergeOptions);\n if (!options.includes(merge)) {\n throw new GeneralError(`merge must be one of the following: ${options.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n\n const importOptions: ImportOptions = {\n ids,\n verbose,\n merge: Boolean(merge),\n mergeStrategy,\n writeToPath: path,\n objectsOnly: objects,\n override,\n writeConfig: Boolean(conf),\n installNpmPackages: !skipDependencyInstallation,\n saveInLane,\n importDependenciesDirectly: dependencies,\n importDependents: dependents,\n allHistory,\n fetchDeps,\n trackOnly,\n };\n const importResults = await this.importer.import(importOptions, this._packageManagerArgs);\n const { importDetails, importedIds, importedDeps, installationError, compilationError, missingIds } = importResults;\n\n if (json) {\n return JSON.stringify({ importDetails, installationError }, null, 4);\n }\n\n if (!importedIds.length && !missingIds?.length) {\n return chalk.yellow(importResults.cancellationMessage || 'nothing to import');\n }\n\n const summaryPrefix =\n importedIds.length === 1\n ? 'successfully imported one component'\n : `successfully imported ${importedIds.length} components`;\n\n let upToDateCount = 0;\n const importedComponents = importedIds.map((bitId) => {\n const details = importDetails.find((c) => c.id === bitId.toStringWithoutVersion());\n if (!details) throw new Error(`missing details of component ${bitId.toString()}`);\n if (details.status === 'up to date') {\n upToDateCount += 1;\n }\n return formatPlainComponentItemWithVersions(bitId, details);\n });\n const upToDateStr = upToDateCount === 0 ? '' : `, ${upToDateCount} components are up to date`;\n const summary = `${summaryPrefix}${upToDateStr}`;\n const importOutput = [...compact(importedComponents), chalk.green(summary)].join('\\n');\n const importedDepsOutput =\n displayDependencies && importedDeps.length\n ? immutableUnshift(\n R.uniq(importedDeps.map(formatPlainComponentItem)),\n chalk.green(`\\n\\nsuccessfully imported ${importedDeps.length} component dependencies`)\n ).join('\\n')\n : '';\n\n const output =\n importOutput +\n importedDepsOutput +\n formatMissingComponents(missingIds) +\n installationErrorOutput(installationError) +\n compilationErrorOutput(compilationError);\n\n return output;\n }\n}\n\nfunction formatMissingComponents(missing?: string[]) {\n if (!missing?.length) return '';\n const title = chalk.underline('Missing Components');\n const subTitle = `The following components are missing from the remote in the requested version, try running \"bit status\" to re-sync your .bitmap file\nAlso, make sure the requested version exists on main or the checked out lane`;\n const body = chalk.red(missing.join('\\n'));\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\n}\n\nfunction formatPlainComponentItemWithVersions(bitId: BitId, importDetails: ImportDetails) {\n const status: ImportStatus = importDetails.status;\n const id = bitId.toStringWithoutVersion();\n const getVersionsOutput = () => {\n if (!importDetails.versions.length) return '';\n if (importDetails.latestVersion) {\n return `${importDetails.versions.length} new version(s) available, latest ${importDetails.latestVersion}`;\n }\n return `new versions: ${importDetails.versions.join(', ')}`;\n };\n const versions = getVersionsOutput();\n const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';\n const getConflictMessage = () => {\n if (!importDetails.filesStatus) return '';\n const conflictedFiles = Object.keys(importDetails.filesStatus)\n // @ts-ignore file is set\n .filter((file) => importDetails.filesStatus[file] === FileStatus.manual);\n if (!conflictedFiles.length) return '';\n return `(the following files were saved with conflicts ${conflictedFiles\n .map((file) => chalk.bold(file))\n .join(', ')}) `;\n };\n const conflictMessage = getConflictMessage();\n const deprecated = importDetails.deprecated && !importDetails.removed ? chalk.yellow('deprecated') : '';\n const removed = importDetails.removed ? chalk.red('removed') : '';\n const missingDeps = importDetails.missingDeps.length\n ? chalk.red(`missing dependencies: ${importDetails.missingDeps.map((d) => d.toString()).join(', ')}`)\n : '';\n if (status === 'up to date' && !missingDeps && !deprecated && !conflictMessage && !removed) {\n return undefined;\n }\n return chalk.dim(\n `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAA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E,OAAO,EAAE;IAC1F,OAAOG,SAAS;EAClB;EACA,OAAOnF,gBAAK,CAACoF,GAAG,CACb,KAAIpF,gBAAK,CAACkD,KAAK,CAACN,MAAM,CAAE,IAAG5C,gBAAK,CAACqF,IAAI,CACpC7C,EAAE,CACF,IAAG0B,QAAS,GAAEE,WAAY,IAAGU,eAAgB,GAAEC,UAAW,GAAEC,OAAQ,IAAGC,WAAY,EAAC,CACvF;AACH"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.481/dist/importer.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.481/dist/importer.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.482/dist/importer.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@0.0.482/dist/importer.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/importer",
3
- "version": "0.0.481",
3
+ "version": "0.0.482",
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": "0.0.481"
9
+ "version": "0.0.482"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -17,17 +17,17 @@
17
17
  "@babel/runtime": "7.20.0",
18
18
  "@teambit/legacy-bit-id": "0.0.423",
19
19
  "@teambit/harmony": "0.4.6",
20
- "@teambit/cli": "0.0.708",
20
+ "@teambit/cli": "0.0.709",
21
21
  "@teambit/bit-error": "0.0.402",
22
- "@teambit/component-writer": "0.0.88",
23
- "@teambit/graph": "0.0.1052",
24
- "@teambit/lane-id": "0.0.225",
25
- "@teambit/workspace": "0.0.1052",
26
- "@teambit/merging": "0.0.367",
27
- "@teambit/dependency-resolver": "0.0.1052",
28
- "@teambit/install": "0.0.162",
29
- "@teambit/logger": "0.0.801",
30
- "@teambit/scope": "0.0.1052"
22
+ "@teambit/component-writer": "0.0.89",
23
+ "@teambit/graph": "0.0.1053",
24
+ "@teambit/lane-id": "0.0.226",
25
+ "@teambit/workspace": "0.0.1053",
26
+ "@teambit/merging": "0.0.368",
27
+ "@teambit/dependency-resolver": "0.0.1053",
28
+ "@teambit/install": "0.0.163",
29
+ "@teambit/logger": "0.0.802",
30
+ "@teambit/scope": "0.0.1053"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/lodash": "4.14.165",
@@ -39,7 +39,7 @@
39
39
  "@types/testing-library__jest-dom": "5.9.5"
40
40
  },
41
41
  "peerDependencies": {
42
- "@teambit/legacy": "1.0.488",
42
+ "@teambit/legacy": "1.0.489",
43
43
  "react": "^16.8.0 || ^17.0.0",
44
44
  "react-dom": "^16.8.0 || ^17.0.0"
45
45
  },