@teambit/importer 0.0.309 → 0.0.311
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fetch-cmd.js +0 -22
- package/dist/fetch-cmd.js.map +1 -1
- package/dist/import-components.js +19 -191
- package/dist/import-components.js.map +1 -1
- package/dist/import.cmd.js +5 -59
- package/dist/import.cmd.js.map +1 -1
- package/dist/importer.aspect.js +0 -5
- package/dist/importer.aspect.js.map +1 -1
- package/dist/importer.composition.js +0 -6
- package/dist/importer.composition.js.map +1 -1
- package/dist/importer.main.runtime.js +1 -96
- package/dist/importer.main.runtime.js.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/package-tar/teambit-importer-0.0.311.tgz +0 -0
- package/package.json +9 -9
- package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
- package/package-tar/teambit-importer-0.0.309.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ImportComponents","constructor","workspace","graph","options","consumer","scope","laneObjects","lanes","importComponents","loader","start","BEFORE_IMPORT_ACTION","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","allHistory","mainIdsLatest","BitIds","fromArray","toBitIds","map","m","changeVersion","ignoreMissingHead","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","result","Promise","all","mergedLane","saveLane","importDetails","_getImportDetails","importedIds","v","component","flat","importedDeps","allDependenciesIds","join","_throwForPotentialIssues","writtenComponents","componentsWithDependencies","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","_writeToFileSystem","_saveLaneDataIfNeeded","c","modelComponent","getModelComponent","setDivergeData","divergeData","push","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnLocalOnly","snapsRemote","snapsOnRemoteOnly","ComponentsPendingMerge","fromOriginalScope","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","results","importManyFromOriginalScopes","importMany","getBitIdsForLanes","bitIdsFromLane","flatMap","mainIds","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","mainIdsToImport","hasScope","hasWithoutVersion","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","BitError","l","name","toStringWithoutVersion","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraph","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","isEmpty","NothingToImport","_throwForModifiedOrNewComponents","componentWithDependencies","authoredExportedComponents","getExportedComponents","versionsP","getModelComponentIfExist","listVersions","versions","fromPairs","currentVersions","components","detailsP","Object","keys","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","latest","includes","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","GeneralError","chalk","yellow","forEach","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","currentLane","getCurrentLaneObject","idsFromRemoteLanes","comp","existOnRemoteLane","has","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriter","ManyComponentsWriter","writeToPath","writeConfig","installNpmPackages","verbose","writeAll"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { ComponentWithDependencies, Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { NothingToImport } from '@teambit/legacy/dist/consumer/exceptions';\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 ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\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';\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};\ntype ComponentMergeStatus = {\n componentWithDependencies: ComponentWithDependencies;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n};\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(private workspace: Workspace, private graph: GraphMain, public options: ImportOptions) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n importComponents(): Promise<ImportResult> {\n loader.start(BEFORE_IMPORT_ACTION);\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n return this.importObjectsOnLane();\n }\n if (this.options.ids.length) {\n return this.importSpecificComponents();\n }\n return this.importAccordingToBitMap();\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n allHistory: this.options.allHistory,\n lane,\n });\n\n // import lane components from their original scope, this way, it's possible to run diff/merge on them.\n // don't use `scope.getDefaultLaneIdsFromLane()`. we need all components, because it's possible that a component\n // does't have \"head\" locally although it exits in the origin-scope. it happens when the component was created on\n // the origin-scope after a component with the same-name was created on the lane\n if (lane) {\n // @todo: optimize this maybe. currently, it imports twice.\n // try to make the previous `importComponentsObjectsHarmony` import the same component once from the original\n // scope and once from the lane-scope.\n const mainIdsLatest = BitIds.fromArray(lane.toBitIds().map((m) => m.changeVersion(undefined)));\n await this._importComponentsObjects(mainIdsLatest, {\n allHistory: this.options.allHistory,\n ignoreMissingHead: true,\n });\n }\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n importDetails,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n if (!this.options.objectsOnly) {\n const componentsWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n await this._fetchDivergeData(componentsWithDependencies);\n this._throwForDivergedHistory();\n await this._writeToFileSystem(componentsWithDependencies);\n await this._saveLaneDataIfNeeded(componentsWithDependencies);\n writtenComponents = componentsWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n };\n }\n\n async _fetchDivergeData(componentsWithDependencies: ComponentWithDependencies[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n componentsWithDependencies.map(async ({ component }) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnLocalOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnRemoteOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n allHistory = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n allHistory?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps(ids, allHistory, lane, ignoreMissingHead);\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({ ids, ignoreMissingHead, lanes: lane ? [lane] : undefined });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const mainIds = this.consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n const mainIdsToImport = mainIds.filter((id) => id.hasScope() && !bitIdsFromLane.hasWithoutVersion(id));\n bitIdsFromLane.push(...mainIdsToImport);\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane || id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraph();\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\n if (R.isEmpty(componentsIdsToImport)) {\n throw new NothingToImport();\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\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 allHistory: this.options.allHistory,\n });\n let writtenComponents: Component[] = [];\n if (!this.options.objectsOnly) {\n const componentWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n await this._writeToFileSystem(componentWithDependencies);\n writtenComponents = componentWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n };\n }\n\n private getIdsToImportFromBitmap() {\n const authoredExportedComponents = this.consumer.bitMap.getExportedComponents();\n return BitIds.fromArray(authoredExportedComponents);\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.latest();\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: component.getMissingDependencies(),\n deprecated,\n removed,\n };\n });\n return Promise.all(detailsP);\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(componentWithDependencies: ComponentWithDependencies): Promise<ComponentMergeStatus> {\n const component = componentWithDependencies.component;\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { componentWithDependencies, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.componentWithDependencies.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(\n componentsWithDependencies: ComponentWithDependencies[]\n ): Promise<ComponentWithDependencies[]> {\n if (!this.options.merge) return componentsWithDependencies;\n const componentsStatusP = componentsWithDependencies.map((componentWithDependencies: ComponentWithDependencies) => {\n return this._getMergeStatus(componentWithDependencies);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const componentWithDependencies = componentStatus.componentWithDependencies;\n if (!filesStatus) return componentWithDependencies;\n this.mergeStatus[componentWithDependencies.component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return componentWithDependencies;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(componentsWithDependencies: ComponentWithDependencies[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n const components = componentsWithDependencies.map((c) => c.component);\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(componentsWithDependencies: ComponentWithDependencies[]) {\n if (this.options.objectsOnly) {\n return;\n }\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies);\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer: this.consumer,\n componentsWithDependencies: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n installNpmPackages: this.options.installNpmPackages,\n verbose: this.options.verbose,\n override: this.options.override,\n });\n await manyComponentsWriter.writeAll();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAQA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;E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KAAKrQ,OAAL,CAAaqQ,WAH0B;MAIpDC,WAAW,EAAE,KAAKtQ,OAAL,CAAasQ,WAJ0B;MAKpDC,kBAAkB,EAAE,KAAKvQ,OAAL,CAAauQ,kBALmB;MAMpDC,OAAO,EAAE,KAAKxQ,OAAL,CAAawQ,OAN8B;MAOpDlH,QAAQ,EAAE,KAAKtJ,OAAL,CAAasJ;IAP6B,CAAzB,CAA7B;IASA,MAAM6G,oBAAoB,CAACM,QAArB,EAAN;EACD;;AA5kBmC"}
|
|
1
|
+
{"version":3,"names":["ImportComponents","constructor","workspace","graph","options","consumer","scope","laneObjects","lanes","importComponents","loader","start","BEFORE_IMPORT_ACTION","saveDependenciesAsComponents","config","_saveDependenciesAsComponents","ids","length","importObjectsOnLane","importSpecificComponents","importAccordingToBitMap","objectsOnly","Error","lane","undefined","bitIds","getBitIds","logger","debug","id","toString","beforeImportVersions","_getCurrentVersions","versionDependenciesArr","_importComponentsObjects","allHistory","mainIdsLatest","BitIds","fromArray","toBitIds","map","m","changeVersion","ignoreMissingHead","mergeAllLanesResults","pMapSeries","laneObject","sources","mergeLane","mergedLanes","result","Promise","all","mergedLane","saveLane","importDetails","_getImportDetails","importedIds","v","component","flat","importedDeps","allDependenciesIds","join","_throwForPotentialIssues","writtenComponents","componentsWithDependencies","multipleVersionDependenciesToConsumer","objects","_fetchDivergeData","_throwForDivergedHistory","_writeToFileSystem","_saveLaneDataIfNeeded","c","modelComponent","getModelComponent","setDivergeData","divergeData","push","merge","divergedComponents","filter","getDivergeData","isDiverged","snapsLocal","snapsOnLocalOnly","snapsRemote","snapsOnRemoteOnly","ComponentsPendingMerge","fromOriginalScope","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","results","importManyFromOriginalScopes","importMany","getBitIdsForLanes","bitIdsFromLane","flatMap","mainIds","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","mainIdsToImport","hasScope","hasWithoutVersion","idsWithWildcard","hasWildcard","idsWithoutWildcard","idsWithoutWildcardPreferFromLane","idStr","BitId","parse","fromLane","searchWithoutVersion","idsFromRemote","getRemoteBitIdsByWildcards","existingOnLanes","BitError","l","name","toStringWithoutVersion","getBitIdsForNonLanes","importDependenciesDirectly","importDependents","graphs","_getComponentsGraphs","dependenciesIds","_getDependenciesFromGraph","getGraph","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","isEmpty","NothingToImport","_throwForModifiedOrNewComponents","componentWithDependencies","authoredExportedComponents","getExportedComponents","versionsP","getModelComponentIfExist","listVersions","versions","fromPairs","currentVersions","components","detailsP","Object","keys","ShowDoctorError","afterImportVersions","versionDifference","difference","getStatus","filesStatus","mergeStatus","deprecated","isDeprecated","removed","isRemoved","latestVersion","latest","includes","status","missingDeps","getMissingDependencies","_throwForDifferentComponentWithSameName","componentsStatuses","getManyComponentsStatuses","modifiedComponents","modified","newlyCreated","GeneralError","chalk","yellow","forEach","existingId","getParsedIdIfExist","_getMergeStatus","componentStatus","getComponentStatusById","mergeResults","componentModel","existingBitMapBitId","getBitId","ignoreVersion","fsComponent","loadComponent","currentlyUsedVersion","version","baseComponent","loadVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel","_updateComponentFilesPerMergeStrategy","componentMergeStatus","files","hasConflicts","mergeStrategy","MergeOptions","ours","file","pathNormalizeToLinux","relative","FileStatus","unchanged","updateComponentId","hasChanged","theirs","updated","modifiedFiles","applyModifiedVersion","updateAllComponentsAccordingToMergeStrategy","componentsStatusP","componentsStatus","componentWithConflict","getMergeStrategyInteractive","componentsToWrite","unchangedFiles","removeNulls","reject","isNil","_shouldSaveLaneData","isOnLane","currentLane","getCurrentLaneObject","idsFromRemoteLanes","comp","existOnRemoteLane","has","saveInLane","setComponentProp","ref","getRef","addComponent","head","manyComponentsWriter","ManyComponentsWriter","writeToPath","writeConfig","installNpmPackages","verbose","writeAll"],"sources":["import-components.ts"],"sourcesContent":["import chalk from 'chalk';\nimport R from 'ramda';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport pMapSeries from 'p-map-series';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BEFORE_IMPORT_ACTION } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport ShowDoctorError from '@teambit/legacy/dist/error/show-doctor-error';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport Remotes from '@teambit/legacy/dist/remotes/remotes';\nimport { ComponentWithDependencies, Scope } from '@teambit/legacy/dist/scope';\nimport DependencyGraph from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport { NothingToImport } from '@teambit/legacy/dist/consumer/exceptions';\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 ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\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';\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};\ntype ComponentMergeStatus = {\n componentWithDependencies: ComponentWithDependencies;\n mergeResults: MergeResultsThreeWay | null | undefined;\n};\ntype ImportedVersions = { [id: string]: string[] };\nexport type ImportStatus = 'added' | 'updated' | 'up to date';\nexport type ImportDetails = {\n id: string;\n versions: string[];\n latestVersion: string | null;\n status: ImportStatus;\n filesStatus: FilesStatus | null | undefined;\n missingDeps: BitId[];\n deprecated: boolean;\n removed?: boolean;\n};\nexport type ImportResult = {\n importedIds: BitId[];\n importedDeps: BitId[];\n writtenComponents?: Component[];\n importDetails: ImportDetails[];\n cancellationMessage?: string;\n};\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(private workspace: Workspace, private graph: GraphMain, public options: ImportOptions) {\n this.consumer = this.workspace.consumer;\n this.scope = this.consumer.scope;\n this.laneObjects = this.options.lanes ? (this.options.lanes.lanes as Lane[]) : [];\n }\n\n importComponents(): Promise<ImportResult> {\n loader.start(BEFORE_IMPORT_ACTION);\n this.options.saveDependenciesAsComponents = this.consumer.config._saveDependenciesAsComponents;\n if (this.options.lanes && !this.options.ids.length) {\n return this.importObjectsOnLane();\n }\n if (this.options.ids.length) {\n return this.importSpecificComponents();\n }\n return this.importAccordingToBitMap();\n }\n\n async importObjectsOnLane(): Promise<ImportResult> {\n if (!this.options.objectsOnly) {\n throw new Error(`importObjectsOnLane should have objectsOnly=true`);\n }\n if (this.laneObjects.length > 1) {\n throw new Error(`importObjectsOnLane does not support more than one lane`);\n }\n const lane = this.laneObjects.length ? this.laneObjects[0] : undefined;\n const bitIds: BitIds = await this.getBitIds();\n lane\n ? logger.debug(`importObjectsOnLane, Lane: ${lane.id()}, Ids: ${bitIds.toString()}`)\n : logger.debug(`importObjectsOnLane, the lane does not exist on the remote. importing only the main components`);\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n allHistory: this.options.allHistory,\n lane,\n });\n\n // import lane components from their original scope, this way, it's possible to run diff/merge on them.\n // don't use `scope.getDefaultLaneIdsFromLane()`. we need all components, because it's possible that a component\n // does't have \"head\" locally although it exits in the origin-scope. it happens when the component was created on\n // the origin-scope after a component with the same-name was created on the lane\n if (lane) {\n // @todo: optimize this maybe. currently, it imports twice.\n // try to make the previous `importComponentsObjectsHarmony` import the same component once from the original\n // scope and once from the lane-scope.\n const mainIdsLatest = BitIds.fromArray(lane.toBitIds().map((m) => m.changeVersion(undefined)));\n await this._importComponentsObjects(mainIdsLatest, {\n allHistory: this.options.allHistory,\n ignoreMissingHead: true,\n });\n }\n\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n importDetails,\n };\n }\n\n async importSpecificComponents(): Promise<ImportResult> {\n logger.debug(`importSpecificComponents, Ids: ${this.options.ids.join(', ')}`);\n const bitIds: BitIds = await this.getBitIds();\n const beforeImportVersions = await this._getCurrentVersions(bitIds);\n await this._throwForPotentialIssues(bitIds);\n const versionDependenciesArr = await this._importComponentsObjects(bitIds, {\n lane: this.laneObjects?.[0],\n });\n if (this.laneObjects && this.options.objectsOnly) {\n // merge the lane objects\n const mergeAllLanesResults = await pMapSeries(this.laneObjects, (laneObject) =>\n this.scope.sources.mergeLane(laneObject, true)\n );\n const mergedLanes = mergeAllLanesResults.map((result) => result.mergeLane);\n await Promise.all(mergedLanes.map((mergedLane) => this.scope.lanes.saveLane(mergedLane)));\n }\n let writtenComponents: Component[] = [];\n if (!this.options.objectsOnly) {\n const componentsWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n await this._fetchDivergeData(componentsWithDependencies);\n this._throwForDivergedHistory();\n await this._writeToFileSystem(componentsWithDependencies);\n await this._saveLaneDataIfNeeded(componentsWithDependencies);\n writtenComponents = componentsWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n };\n }\n\n async _fetchDivergeData(componentsWithDependencies: ComponentWithDependencies[]) {\n if (this.options.objectsOnly) {\n // no need for it when importing objects only. if it's enabled, in case when on a lane and a non-lane\n // component is in bitmap using an older version, it throws \"getDivergeData: unable to find Version X of Y\"\n return;\n }\n await Promise.all(\n componentsWithDependencies.map(async ({ component }) => {\n const modelComponent = await this.scope.getModelComponent(component.id);\n await modelComponent.setDivergeData(this.scope.objects, undefined, false);\n this.divergeData.push(modelComponent);\n })\n );\n }\n\n _throwForDivergedHistory() {\n if (this.options.merge || this.options.objectsOnly) return;\n const divergedComponents = this.divergeData.filter((modelComponent) =>\n modelComponent.getDivergeData().isDiverged()\n );\n if (divergedComponents.length) {\n const divergeData = divergedComponents.map((modelComponent) => ({\n id: modelComponent.id(),\n snapsLocal: modelComponent.getDivergeData().snapsOnLocalOnly.length,\n snapsRemote: modelComponent.getDivergeData().snapsOnRemoteOnly.length,\n }));\n throw new ComponentsPendingMerge(divergeData);\n }\n }\n\n private async _importComponentsObjects(\n ids: BitIds,\n {\n fromOriginalScope = false,\n allHistory = false,\n lane,\n ignoreMissingHead = false,\n }: {\n fromOriginalScope?: boolean;\n allHistory?: boolean;\n lane?: Lane;\n ignoreMissingHead?: boolean;\n }\n ): Promise<VersionDependencies[]> {\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps(ids, allHistory, lane, ignoreMissingHead);\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({ ids, ignoreMissingHead, lanes: lane ? [lane] : undefined });\n\n return results;\n }\n\n /**\n * consider the following use cases:\n * 1) no ids were provided. it should import all the lanes components objects AND main components objects\n * (otherwise, if main components are not imported and are missing, then bit-status complains about it)\n * 2) ids are provided with wildcards. we assume the user wants only the ids that are available on the lane.\n * because a user may entered \"bit import scope/*\" and this scope has many component on the lane and many not on the lane.\n * we want to bring only the components on the lane.\n * 3) ids are provided without wildcards. here, the user knows exactly what's needed and it's ok to get the ids from\n * main if not found on the lane.\n */\n private async getBitIdsForLanes(): Promise<BitId[]> {\n if (!this.options.lanes) {\n throw new Error(`getBitIdsForLanes: this.options.lanes must be set`);\n }\n const bitIdsFromLane = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n\n if (!this.options.ids.length) {\n const mainIds = this.consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n const mainIdsToImport = mainIds.filter((id) => id.hasScope() && !bitIdsFromLane.hasWithoutVersion(id));\n bitIdsFromLane.push(...mainIdsToImport);\n return bitIdsFromLane;\n }\n\n const idsWithWildcard = this.options.ids.filter((id) => hasWildcard(id));\n const idsWithoutWildcard = this.options.ids.filter((id) => !hasWildcard(id));\n const idsWithoutWildcardPreferFromLane = idsWithoutWildcard.map((idStr) => {\n const id = BitId.parse(idStr, true);\n const fromLane = bitIdsFromLane.searchWithoutVersion(id);\n return fromLane || id;\n });\n\n const bitIds: BitId[] = [...idsWithoutWildcardPreferFromLane];\n\n if (!idsWithWildcard) {\n return bitIds;\n }\n\n await pMapSeries(idsWithWildcard, async (idStr: string) => {\n const idsFromRemote = await getRemoteBitIdsByWildcards(idStr);\n const existingOnLanes = idsFromRemote.filter((id) => bitIdsFromLane.hasWithoutVersion(id));\n if (!existingOnLanes.length) {\n throw new BitError(`the id with the the wildcard \"${idStr}\" has been parsed to multiple component ids.\nhowever, none of them existing on the lane \"${this.laneObjects.map((l) => l.name).join(', ')}\"\nin case you intend to import these components from main, please run the following:\nbit import ${idsFromRemote.map((id) => id.toStringWithoutVersion()).join(' ')}`);\n }\n bitIds.push(...existingOnLanes);\n });\n\n return bitIds;\n }\n\n private async getBitIdsForNonLanes() {\n const bitIds: BitId[] = [];\n await Promise.all(\n this.options.ids.map(async (idStr: string) => {\n if (hasWildcard(idStr)) {\n const ids = await getRemoteBitIdsByWildcards(idStr);\n loader.start(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST\n bitIds.push(...ids);\n } else {\n bitIds.push(BitId.parse(idStr, true)); // we don't support importing without a scope name\n }\n })\n );\n\n return bitIds;\n }\n\n private async getBitIds(): Promise<BitIds> {\n const bitIds: BitId[] = this.options.lanes ? await this.getBitIdsForLanes() : await this.getBitIdsForNonLanes();\n if (this.options.importDependenciesDirectly || this.options.importDependents) {\n const graphs = await this._getComponentsGraphs(bitIds);\n if (this.options.importDependenciesDirectly) {\n const dependenciesIds = this._getDependenciesFromGraph(bitIds, graphs);\n bitIds.push(...dependenciesIds);\n }\n if (this.options.importDependents) {\n const graph = await this.graph.getGraph();\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\n if (R.isEmpty(componentsIdsToImport)) {\n throw new NothingToImport();\n }\n await this._throwForModifiedOrNewComponents(componentsIdsToImport);\n const beforeImportVersions = await this._getCurrentVersions(componentsIdsToImport);\n if (!componentsIdsToImport.length) {\n return {\n importedIds: [],\n importedDeps: [],\n importDetails: [],\n };\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 allHistory: this.options.allHistory,\n });\n let writtenComponents: Component[] = [];\n if (!this.options.objectsOnly) {\n const componentWithDependencies = await multipleVersionDependenciesToConsumer(\n versionDependenciesArr,\n this.scope.objects\n );\n await this._writeToFileSystem(componentWithDependencies);\n writtenComponents = componentWithDependencies.map((c) => c.component);\n }\n\n const importDetails = await this._getImportDetails(beforeImportVersions, versionDependenciesArr);\n\n return {\n importedIds: versionDependenciesArr.map((v) => v.component.id).flat(),\n importedDeps: versionDependenciesArr.map((v) => v.allDependenciesIds).flat(),\n writtenComponents,\n importDetails,\n };\n }\n\n private getIdsToImportFromBitmap() {\n const authoredExportedComponents = this.consumer.bitMap.getExportedComponents();\n return BitIds.fromArray(authoredExportedComponents);\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.latest();\n return {\n id: idStr,\n versions: versionDifference,\n latestVersion: versionDifference.includes(latestVersion) ? latestVersion : null,\n status: getStatus(),\n filesStatus,\n missingDeps: component.getMissingDependencies(),\n deprecated,\n removed,\n };\n });\n return Promise.all(detailsP);\n }\n\n async _throwForPotentialIssues(ids: BitIds): Promise<void> {\n await this._throwForModifiedOrNewComponents(ids);\n this._throwForDifferentComponentWithSameName(ids);\n }\n\n async _throwForModifiedOrNewComponents(ids: BitIds): Promise<void> {\n // the typical objectsOnly option is when a user cloned a project with components tagged to the source code, but\n // doesn't have the model objects. in that case, calling getComponentStatusById() may return an error as it relies\n // on the model objects when there are dependencies\n if (this.options.override || this.options.objectsOnly || this.options.merge) return;\n const componentsStatuses = await this.consumer.getManyComponentsStatuses(ids);\n const modifiedComponents = componentsStatuses\n .filter(({ status }) => status.modified || status.newlyCreated)\n .map((c) => c.id);\n if (modifiedComponents.length) {\n throw new GeneralError(\n chalk.yellow(\n `unable to import the following components due to local changes, use --merge flag to merge your local changes or --override to override them\\n${modifiedComponents.join(\n '\\n'\n )} `\n )\n );\n }\n }\n\n /**\n * Model Component id() calculation uses id.toString() for the hash.\n * If an imported component has scopereadonly name equals to a local name, both will have the exact same\n * hash and they'll override each other.\n */\n _throwForDifferentComponentWithSameName(ids: BitIds): void {\n ids.forEach((id: BitId) => {\n const existingId = this.consumer.getParsedIdIfExist(id.toStringWithoutVersion());\n if (existingId && !existingId.hasScope()) {\n throw new GeneralError(`unable to import ${id.toString()}. the component name conflicted with your local component with the same name.\n it's fine to have components with the same name as long as their scope names are different.\n Make sure to export your component first to get a scope and then try importing again`);\n }\n });\n }\n\n async _getMergeStatus(componentWithDependencies: ComponentWithDependencies): Promise<ComponentMergeStatus> {\n const component = componentWithDependencies.component;\n const componentStatus = await this.consumer.getComponentStatusById(component.id);\n const mergeStatus: ComponentMergeStatus = { componentWithDependencies, mergeResults: null };\n if (!componentStatus.modified) return mergeStatus;\n const componentModel = await this.consumer.scope.getModelComponent(component.id);\n const existingBitMapBitId = this.consumer.bitMap.getBitId(component.id, { ignoreVersion: true });\n const fsComponent = await this.consumer.loadComponent(existingBitMapBitId);\n const currentlyUsedVersion = existingBitMapBitId.version;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await componentModel.loadVersion(currentlyUsedVersion, this.consumer.scope.objects);\n const otherComponent: Version = await componentModel.loadVersion(\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n component.id.version,\n this.consumer.scope.objects\n );\n const mergeResults = await threeWayMerge({\n consumer: this.consumer,\n otherComponent,\n otherLabel: component.id.version as string,\n currentComponent: fsComponent,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n mergeStatus.mergeResults = mergeResults;\n return mergeStatus;\n }\n\n /**\n * 1) when there are conflicts and the strategy is \"ours\", don't write the imported component to\n * the filesystem, only update bitmap.\n *\n * 2) when there are conflicts and the strategy is \"theirs\", override the local changes by the\n * imported component. (similar to --override)\n *\n * 3) when there is no conflict or there are conflicts and the strategy is manual, write the files\n * according to the merge result. (done by applyModifiedVersion())\n */\n _updateComponentFilesPerMergeStrategy(componentMergeStatus: ComponentMergeStatus): FilesStatus | null | undefined {\n const mergeResults = componentMergeStatus.mergeResults;\n if (!mergeResults) return null;\n const component = componentMergeStatus.componentWithDependencies.component;\n const files = component.files;\n\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.ours) {\n const filesStatus = {};\n // don't write the files to the filesystem, only bump the bitmap version.\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n this.consumer.bitMap.updateComponentId(component.id);\n this.consumer.bitMap.hasChanged = true;\n return filesStatus;\n }\n if (mergeResults.hasConflicts && this.options.mergeStrategy === MergeOptions.theirs) {\n const filesStatus = {};\n // the local changes will be overridden (as if the user entered --override flag for this component)\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n return filesStatus;\n }\n const { filesStatus, modifiedFiles } = applyModifiedVersion(\n component.files,\n mergeResults,\n this.options.mergeStrategy\n );\n component.files = modifiedFiles;\n\n return filesStatus;\n }\n\n /**\n * update the component files if they are modified and there is a merge strategy.\n * returns only the components that need to be written to the filesystem\n */\n async updateAllComponentsAccordingToMergeStrategy(\n componentsWithDependencies: ComponentWithDependencies[]\n ): Promise<ComponentWithDependencies[]> {\n if (!this.options.merge) return componentsWithDependencies;\n const componentsStatusP = componentsWithDependencies.map((componentWithDependencies: ComponentWithDependencies) => {\n return this._getMergeStatus(componentWithDependencies);\n });\n const componentsStatus = await Promise.all(componentsStatusP);\n const componentWithConflict = componentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !this.options.mergeStrategy) {\n this.options.mergeStrategy = await getMergeStrategyInteractive();\n }\n this.mergeStatus = {};\n\n const componentsToWrite = componentsStatus.map((componentStatus) => {\n const filesStatus: FilesStatus | null | undefined = this._updateComponentFilesPerMergeStrategy(componentStatus);\n const componentWithDependencies = componentStatus.componentWithDependencies;\n if (!filesStatus) return componentWithDependencies;\n this.mergeStatus[componentWithDependencies.component.id.toStringWithoutVersion()] = filesStatus;\n const unchangedFiles = Object.keys(filesStatus).filter((file) => filesStatus[file] === FileStatus.unchanged);\n if (unchangedFiles.length === Object.keys(filesStatus).length) {\n // all files are unchanged\n return null;\n }\n return componentWithDependencies;\n });\n const removeNulls = R.reject(R.isNil);\n return removeNulls(componentsToWrite);\n }\n\n _shouldSaveLaneData(): boolean {\n if (this.options.objectsOnly) {\n return false;\n }\n return this.consumer.isOnLane();\n }\n\n async _saveLaneDataIfNeeded(componentsWithDependencies: ComponentWithDependencies[]): Promise<void> {\n if (!this._shouldSaveLaneData()) {\n return;\n }\n const currentLane = await this.consumer.getCurrentLaneObject();\n if (!currentLane) {\n return; // user on main\n }\n const idsFromRemoteLanes = BitIds.fromArray(this.laneObjects.flatMap((lane) => lane.toBitIds()));\n const components = componentsWithDependencies.map((c) => c.component);\n await Promise.all(\n components.map(async (comp) => {\n const existOnRemoteLane = idsFromRemoteLanes.has(comp.id);\n if (!existOnRemoteLane && !this.options.saveInLane) {\n this.consumer.bitMap.setComponentProp(comp.id, 'onLanesOnly', false);\n return;\n }\n const modelComponent = await this.scope.getModelComponent(comp.id);\n const ref = modelComponent.getRef(comp.id.version as string);\n if (!ref) throw new Error(`_saveLaneDataIfNeeded unable to get ref for ${comp.id.toString()}`);\n currentLane.addComponent({ id: comp.id, head: ref });\n })\n );\n await this.scope.lanes.saveLane(currentLane);\n }\n\n async _writeToFileSystem(componentsWithDependencies: ComponentWithDependencies[]) {\n if (this.options.objectsOnly) {\n return;\n }\n const componentsToWrite = await this.updateAllComponentsAccordingToMergeStrategy(componentsWithDependencies);\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer: this.consumer,\n componentsWithDependencies: componentsToWrite,\n writeToPath: this.options.writeToPath,\n writeConfig: this.options.writeConfig,\n installNpmPackages: this.options.installNpmPackages,\n verbose: this.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,EAAE,IAAI,CAACtJ,OAAO,CAACsJ;IACzB,CAAC,CAAC;IACF,MAAM6G,oBAAoB,CAACM,QAAQ,EAAE;EACvC;AACF;AAAC"}
|
package/dist/import.cmd.js
CHANGED
|
@@ -1,108 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.ImportCmd = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _chalk() {
|
|
25
18
|
const data = _interopRequireDefault(require("chalk"));
|
|
26
|
-
|
|
27
19
|
_chalk = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _lodash() {
|
|
35
25
|
const data = require("lodash");
|
|
36
|
-
|
|
37
26
|
_lodash = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _ramda() {
|
|
45
32
|
const data = _interopRequireDefault(require("ramda"));
|
|
46
|
-
|
|
47
33
|
_ramda = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _constants() {
|
|
55
39
|
const data = require("@teambit/legacy/dist/constants");
|
|
56
|
-
|
|
57
40
|
_constants = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
function _mergeVersion() {
|
|
65
46
|
const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version/merge-version");
|
|
66
|
-
|
|
67
47
|
_mergeVersion = function () {
|
|
68
48
|
return data;
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
return data;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
function _generalError() {
|
|
75
53
|
const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
|
|
76
|
-
|
|
77
54
|
_generalError = function () {
|
|
78
55
|
return data;
|
|
79
56
|
};
|
|
80
|
-
|
|
81
57
|
return data;
|
|
82
58
|
}
|
|
83
|
-
|
|
84
59
|
function _utils() {
|
|
85
60
|
const data = require("@teambit/legacy/dist/utils");
|
|
86
|
-
|
|
87
61
|
_utils = function () {
|
|
88
62
|
return data;
|
|
89
63
|
};
|
|
90
|
-
|
|
91
64
|
return data;
|
|
92
65
|
}
|
|
93
|
-
|
|
94
66
|
function _chalkBox() {
|
|
95
67
|
const data = require("@teambit/legacy/dist/cli/chalk-box");
|
|
96
|
-
|
|
97
68
|
_chalkBox = function () {
|
|
98
69
|
return data;
|
|
99
70
|
};
|
|
100
|
-
|
|
101
71
|
return data;
|
|
102
72
|
}
|
|
103
|
-
|
|
104
73
|
class ImportCmd {
|
|
105
74
|
// gets populated by yargs-adapter.handler().
|
|
75
|
+
|
|
106
76
|
constructor(importer, docsDomain) {
|
|
107
77
|
this.importer = importer;
|
|
108
78
|
this.docsDomain = docsDomain;
|
|
@@ -115,7 +85,8 @@ class ImportCmd {
|
|
|
115
85
|
(0, _defineProperty2().default)(this, "extendedDescription", void 0);
|
|
116
86
|
(0, _defineProperty2().default)(this, "group", 'collaborate');
|
|
117
87
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
118
|
-
(0, _defineProperty2().default)(this, "options", [['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'], ['o', 'objects', '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'], ['d', 'display-dependencies', 'display the imported dependencies'], ['O', 'override', 'override local changes'], ['v', 'verbose', 'show verbose output for inspection'], ['j', 'json', 'return the output as JSON'],
|
|
88
|
+
(0, _defineProperty2().default)(this, "options", [['p', 'path <path>', 'import components into a specific directory (a relative path in the workspace)'], ['o', 'objects', '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'], ['d', 'display-dependencies', 'display the imported dependencies'], ['O', 'override', 'override local changes'], ['v', 'verbose', 'show verbose output for inspection'], ['j', 'json', 'return the output as JSON'],
|
|
89
|
+
// ['', 'conf', 'write the configuration file (component.json) of the component'], // not working. need to fix once ComponentWriter is moved to Harmony
|
|
119
90
|
['', 'skip-npm-install', 'DEPRECATED. use "--skip-dependency-installation" instead'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['m', 'merge [strategy]', 'merge local changes with the imported version. strategy should be "theirs", "ours" or "manual"'], ['', 'dependencies', 'EXPERIMENTAL. import all dependencies and write them to the workspace'], ['', 'dependents', 'EXPERIMENTAL. import components found while traversing from the given ids upwards to the workspace components'], ['', 'save-in-lane', '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)'], ['', 'all-history', 'relevant for fetching all components objects. avoid optimizations, fetch all history versions, always']]);
|
|
120
91
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
121
92
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
@@ -124,7 +95,6 @@ class ImportCmd {
|
|
|
124
95
|
this.extendedDescription = `https://${docsDomain}/components/importing-components
|
|
125
96
|
${(0, _constants().WILDCARD_HELP)('import')}`;
|
|
126
97
|
}
|
|
127
|
-
|
|
128
98
|
async report([ids = []], {
|
|
129
99
|
path,
|
|
130
100
|
objects = false,
|
|
@@ -144,37 +114,28 @@ ${(0, _constants().WILDCARD_HELP)('import')}`;
|
|
|
144
114
|
if (objects && merge) {
|
|
145
115
|
throw new (_generalError().default)('you cant use --objects and --merge flags combined');
|
|
146
116
|
}
|
|
147
|
-
|
|
148
117
|
if (override && merge) {
|
|
149
118
|
throw new (_generalError().default)('you cant use --override and --merge flags combined');
|
|
150
119
|
}
|
|
151
|
-
|
|
152
120
|
if (!ids.length && dependencies) {
|
|
153
121
|
throw new (_generalError().default)('you have to specify ids to use "--dependencies" flag');
|
|
154
122
|
}
|
|
155
|
-
|
|
156
123
|
if (!ids.length && dependents) {
|
|
157
124
|
throw new (_generalError().default)('you have to specify ids to use "--dependents" flag');
|
|
158
125
|
}
|
|
159
|
-
|
|
160
126
|
if (skipNpmInstall) {
|
|
161
127
|
// eslint-disable-next-line no-console
|
|
162
128
|
console.log(_chalk().default.yellow(`"--skip-npm-install" has been deprecated, please use "--skip-dependency-installation" instead`));
|
|
163
129
|
skipDependencyInstallation = true;
|
|
164
130
|
}
|
|
165
|
-
|
|
166
131
|
let mergeStrategy;
|
|
167
|
-
|
|
168
132
|
if (merge && _ramda().default.is(String, merge)) {
|
|
169
133
|
const options = Object.keys(_mergeVersion().MergeOptions);
|
|
170
|
-
|
|
171
134
|
if (!options.includes(merge)) {
|
|
172
135
|
throw new (_generalError().default)(`merge must be one of the following: ${options.join(', ')}`);
|
|
173
136
|
}
|
|
174
|
-
|
|
175
137
|
mergeStrategy = merge;
|
|
176
138
|
}
|
|
177
|
-
|
|
178
139
|
const importOptions = {
|
|
179
140
|
ids,
|
|
180
141
|
verbose,
|
|
@@ -196,27 +157,22 @@ ${(0, _constants().WILDCARD_HELP)('import')}`;
|
|
|
196
157
|
importedIds,
|
|
197
158
|
importedDeps
|
|
198
159
|
} = importResults;
|
|
199
|
-
|
|
200
160
|
if (json) {
|
|
201
161
|
return JSON.stringify({
|
|
202
162
|
importDetails
|
|
203
163
|
}, null, 4);
|
|
204
164
|
}
|
|
205
|
-
|
|
206
165
|
if (!importedIds.length) {
|
|
207
166
|
return _chalk().default.yellow(importResults.cancellationMessage || 'nothing to import');
|
|
208
167
|
}
|
|
209
|
-
|
|
210
168
|
const titlePrefix = importedIds.length === 1 ? 'successfully imported one component' : `successfully imported ${importedIds.length} components`;
|
|
211
169
|
let upToDateCount = 0;
|
|
212
170
|
const importedComponents = importedIds.map(bitId => {
|
|
213
171
|
const details = importDetails.find(c => c.id === bitId.toStringWithoutVersion());
|
|
214
172
|
if (!details) throw new Error(`missing details of component ${bitId.toString()}`);
|
|
215
|
-
|
|
216
173
|
if (details.status === 'up to date') {
|
|
217
174
|
upToDateCount += 1;
|
|
218
175
|
}
|
|
219
|
-
|
|
220
176
|
return formatPlainComponentItemWithVersions(bitId, details);
|
|
221
177
|
});
|
|
222
178
|
const upToDateStr = upToDateCount === 0 ? '' : `, ${upToDateCount} components are up to date`;
|
|
@@ -226,45 +182,35 @@ ${(0, _constants().WILDCARD_HELP)('import')}`;
|
|
|
226
182
|
const dependenciesOutput = componentDependenciesOutput + importedDepsOutput;
|
|
227
183
|
return dependenciesOutput;
|
|
228
184
|
}
|
|
229
|
-
|
|
230
185
|
}
|
|
231
|
-
|
|
232
186
|
exports.ImportCmd = ImportCmd;
|
|
233
|
-
|
|
234
187
|
function formatPlainComponentItemWithVersions(bitId, importDetails) {
|
|
235
188
|
const status = importDetails.status;
|
|
236
189
|
const id = bitId.toStringWithoutVersion();
|
|
237
|
-
|
|
238
190
|
const getVersionsOutput = () => {
|
|
239
191
|
if (!importDetails.versions.length) return '';
|
|
240
|
-
|
|
241
192
|
if (importDetails.latestVersion) {
|
|
242
193
|
return `${importDetails.versions.length} new version(s) available, latest ${importDetails.latestVersion}`;
|
|
243
194
|
}
|
|
244
|
-
|
|
245
195
|
return `new versions: ${importDetails.versions.join(', ')}`;
|
|
246
196
|
};
|
|
247
|
-
|
|
248
197
|
const versions = getVersionsOutput();
|
|
249
198
|
const usedVersion = status === 'added' ? `, currently used version ${bitId.version}` : '';
|
|
250
|
-
|
|
251
199
|
const getConflictMessage = () => {
|
|
252
200
|
if (!importDetails.filesStatus) return '';
|
|
253
|
-
const conflictedFiles = Object.keys(importDetails.filesStatus)
|
|
201
|
+
const conflictedFiles = Object.keys(importDetails.filesStatus)
|
|
202
|
+
// @ts-ignore file is set
|
|
254
203
|
.filter(file => importDetails.filesStatus[file] === _mergeVersion().FileStatus.manual);
|
|
255
204
|
if (!conflictedFiles.length) return '';
|
|
256
205
|
return `(the following files were saved with conflicts ${conflictedFiles.map(file => _chalk().default.bold(file)).join(', ')}) `;
|
|
257
206
|
};
|
|
258
|
-
|
|
259
207
|
const conflictMessage = getConflictMessage();
|
|
260
208
|
const deprecated = importDetails.deprecated ? _chalk().default.yellow('deprecated') : '';
|
|
261
209
|
const removed = importDetails.removed ? _chalk().default.red('removed') : '';
|
|
262
210
|
const missingDeps = importDetails.missingDeps.length ? _chalk().default.red(`missing dependencies: ${importDetails.missingDeps.map(d => d.toString()).join(', ')}`) : '';
|
|
263
|
-
|
|
264
211
|
if (status === 'up to date' && !missingDeps && !deprecated && !conflictMessage) {
|
|
265
212
|
return undefined;
|
|
266
213
|
}
|
|
267
|
-
|
|
268
214
|
return `- ${_chalk().default.green(status)} ${_chalk().default.cyan(id)} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`;
|
|
269
215
|
}
|
|
270
216
|
|
package/dist/import.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ImportCmd","constructor","importer","docsDomain","name","description","extendedDescription","WILDCARD_HELP","report","ids","path","objects","displayDependencies","override","verbose","json","conf","skipNpmInstall","skipDependencyInstallation","merge","saveInLane","dependencies","dependents","allHistory","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","JSON","stringify","cancellationMessage","titlePrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","upToDateStr","title","componentDependenciesOutput","green","compact","importedDepsOutput","immutableUnshift","uniq","formatPlainComponentItem","dependenciesOutput","getVersionsOutput","versions","latestVersion","usedVersion","version","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","deprecated","removed","red","missingDeps","d","undefined","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 { WILDCARD_HELP } from '@teambit/legacy/dist/constants';\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 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 ['', '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 ] 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, private docsDomain: string) {\n this.extendedDescription = `https://${docsDomain}/components/importing-components\n${WILDCARD_HELP('import')}`;\n }\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 }: {\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 }\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 (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 };\n const importResults = await this.importer.import(importOptions, this._packageManagerArgs);\n const { importDetails, importedIds, importedDeps } = importResults;\n\n if (json) {\n return JSON.stringify({ importDetails }, null, 4);\n }\n\n if (!importedIds.length) {\n return chalk.yellow(importResults.cancellationMessage || 'nothing to import');\n }\n\n const titlePrefix =\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 title = `${titlePrefix}${upToDateStr}`;\n const componentDependenciesOutput = [chalk.green(title), ...compact(importedComponents)].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 dependenciesOutput = componentDependenciesOutput + importedDepsOutput;\n\n return dependenciesOutput;\n }\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 ? 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) {\n return undefined;\n }\n return `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`;\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;E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C,aAAa,CAAC+C,WAAd,CAA0BzE,MAA1B,GAChBG,gBAAA,CAAMqE,GAAN,CAAW,yBAAwB9C,aAAa,CAAC+C,WAAd,CAA0BtC,GAA1B,CAA+BuC,CAAD,IAAOA,CAAC,CAAC/B,QAAF,EAArC,EAAmD7B,IAAnD,CAAwD,IAAxD,CAA8D,EAAjG,CADgB,GAEhB,EAFJ;;EAGA,IAAI8B,MAAM,KAAK,YAAX,IAA2B,CAAC6B,WAA5B,IAA2C,CAACH,UAA5C,IAA0D,CAACD,eAA/D,EAAgF;IAC9E,OAAOM,SAAP;EACD;;EACD,OAAQ,KAAIxE,gBAAA,CAAM8C,KAAN,CAAYL,MAAZ,CAAoB,IAAGzC,gBAAA,CAAMyE,IAAN,CACjCpC,EADiC,CAEjC,IAAGiB,QAAS,GAAEE,WAAY,IAAGU,eAAgB,GAAEC,UAAW,GAAEC,OAAQ,IAAGE,WAAY,EAFrF;AAGD"}
|
|
1
|
+
{"version":3,"names":["ImportCmd","constructor","importer","docsDomain","name","description","extendedDescription","WILDCARD_HELP","report","ids","path","objects","displayDependencies","override","verbose","json","conf","skipNpmInstall","skipDependencyInstallation","merge","saveInLane","dependencies","dependents","allHistory","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","JSON","stringify","cancellationMessage","titlePrefix","upToDateCount","importedComponents","map","bitId","details","find","c","id","toStringWithoutVersion","Error","toString","status","formatPlainComponentItemWithVersions","upToDateStr","title","componentDependenciesOutput","green","compact","importedDepsOutput","immutableUnshift","uniq","formatPlainComponentItem","dependenciesOutput","getVersionsOutput","versions","latestVersion","usedVersion","version","getConflictMessage","filesStatus","conflictedFiles","filter","file","FileStatus","manual","bold","conflictMessage","deprecated","removed","red","missingDeps","d","undefined","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 { WILDCARD_HELP } from '@teambit/legacy/dist/constants';\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 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 ['', '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 ] 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, private docsDomain: string) {\n this.extendedDescription = `https://${docsDomain}/components/importing-components\n${WILDCARD_HELP('import')}`;\n }\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 }: {\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 }\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 (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 };\n const importResults = await this.importer.import(importOptions, this._packageManagerArgs);\n const { importDetails, importedIds, importedDeps } = importResults;\n\n if (json) {\n return JSON.stringify({ importDetails }, null, 4);\n }\n\n if (!importedIds.length) {\n return chalk.yellow(importResults.cancellationMessage || 'nothing to import');\n }\n\n const titlePrefix =\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 title = `${titlePrefix}${upToDateStr}`;\n const componentDependenciesOutput = [chalk.green(title), ...compact(importedComponents)].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 dependenciesOutput = componentDependenciesOutput + importedDepsOutput;\n\n return dependenciesOutput;\n }\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 ? 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) {\n return undefined;\n }\n return `- ${chalk.green(status)} ${chalk.cyan(\n id\n )} ${versions}${usedVersion} ${conflictMessage}${deprecated}${removed} ${missingDeps}`;\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;EAoDT;;EAE/BC,WAAW,CAASC,QAAsB,EAAUC,UAAkB,EAAE;IAAA,KAApDD,QAAsB,GAAtBA,QAAsB;IAAA,KAAUC,UAAkB,GAAlBA,UAAkB;IAAA,8CArD/D,gCAAgC;IAAA,qDACzB,mEAAmE;IAAA,mDACrE,CACV;MACEC,IAAI,EAAE,uBAAuB;MAC7BC,WAAW,EACT;IACJ,CAAC,CACF;IAAA;IAAA,+CAEO,aAAa;IAAA,+CACb,EA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