@teambit/snapping 1.0.480 → 1.0.482

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { ReleaseType } from 'semver';
2
2
  import { ComponentID, ComponentIdList } from '@teambit/component-id';
3
3
  import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
4
+ import { Component } from '@teambit/component';
4
5
  import { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';
5
6
  import { ModelComponent } from '@teambit/legacy/dist/scope/models';
6
7
  import { StagedConfig } from '@teambit/scope';
@@ -25,8 +26,9 @@ export type BasicTagParams = BasicTagSnapParams & {
25
26
  editor?: string;
26
27
  unmodified?: boolean;
27
28
  };
28
- export declare function tagModelComponent({ snapping, consumerComponents, ids, tagDataPerComp, populateArtifactsFrom, populateArtifactsIgnorePkgJson, message, editor, exactVersion, releaseType, preReleaseId, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, soft, build, persist, isSnap, disableTagAndSnapPipelines, ignoreBuildErrors, rebuildDepsGraph, incrementBy, packageManagerConfigRootDir, copyLogFromPreviousSnap, exitOnFirstFailedTask, updateDependentsOnLane, }: {
29
+ export declare function tagModelComponent({ snapping, consumerComponents, components, ids, tagDataPerComp, populateArtifactsFrom, populateArtifactsIgnorePkgJson, message, editor, exactVersion, releaseType, preReleaseId, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, soft, build, persist, isSnap, disableTagAndSnapPipelines, ignoreBuildErrors, rebuildDepsGraph, incrementBy, packageManagerConfigRootDir, copyLogFromPreviousSnap, exitOnFirstFailedTask, updateDependentsOnLane, }: {
29
30
  snapping: SnappingMain;
31
+ components: Component[];
30
32
  consumerComponents: ConsumerComponent[];
31
33
  ids: ComponentIdList;
32
34
  tagDataPerComp?: TagDataPerComp[];
@@ -110,6 +110,13 @@ function _autoTag() {
110
110
  };
111
111
  return data;
112
112
  }
113
+ function _dependenciesGraph() {
114
+ const data = require("@teambit/legacy/dist/scope/models/dependencies-graph");
115
+ _dependenciesGraph = function () {
116
+ return data;
117
+ };
118
+ return data;
119
+ }
113
120
  function _messagePerComponent() {
114
121
  const data = require("@teambit/legacy/dist/scope/component-ops/message-per-component");
115
122
  _messagePerComponent = function () {
@@ -208,6 +215,7 @@ function getVersionByEnteredId(enteredIds, component, modelComponent) {
208
215
  async function tagModelComponent({
209
216
  snapping,
210
217
  consumerComponents,
218
+ components,
211
219
  ids,
212
220
  tagDataPerComp,
213
221
  populateArtifactsFrom,
@@ -299,6 +307,7 @@ async function tagModelComponent({
299
307
  }
300
308
  _logger().default.debugAndAddBreadCrumb('tag-model-components', 'sequentially persist all components');
301
309
  setCurrentSchema(allComponentsToTag);
310
+
302
311
  // go through all components and find the future versions for them
303
312
  isSnap ? setHashes(allComponentsToTag) : await setFutureVersions(allComponentsToTag, legacyScope, releaseType, exactVersion, persist, autoTagIds, ids, incrementBy, preReleaseId, soft, tagDataPerComp);
304
313
  // go through all dependencies and update their versions
@@ -314,6 +323,7 @@ async function tagModelComponent({
314
323
  consumer.updateNextVersionOnBitmap(allComponentsToTag, preReleaseId);
315
324
  } else {
316
325
  await snapping._addFlattenedDependenciesToComponents(allComponentsToTag, rebuildDepsGraph);
326
+ await snapping._addDependenciesGraphToComponents(components);
317
327
  await snapping.throwForDepsFromAnotherLane(allComponentsToTag);
318
328
  if (!build) emptyBuilderData(allComponentsToTag);
319
329
  addBuildStatus(allComponentsToTag, _constants().BuildStatus.Pending);
@@ -356,7 +366,9 @@ async function tagModelComponent({
356
366
  } = await builder.tagListener(harmonyComps, onTagOpts, isolateOptions, builderOptions);
357
367
  const buildResult = scope.builderDataMapToLegacyOnTagResults(builderDataMap);
358
368
  snapping._updateComponentsByTagResult(componentsToBuild, buildResult);
359
- publishedPackages.push(...snapping._getPublishedPackages(componentsToBuild));
369
+ const packageIntegritiesByPublishedPackages = snapping._getPublishedPackages(componentsToBuild);
370
+ publishedPackages.push(...Array.from(packageIntegritiesByPublishedPackages.keys()));
371
+ addIntegritiesToConsumerComponentsGraphs(packageIntegritiesByPublishedPackages, allComponentsToTag);
360
372
  addBuildStatus(componentsToBuild, _constants().BuildStatus.Succeed);
361
373
  await (0, _pMapSeries().default)(componentsToBuild, consumerComponent => snapping._enrichComp(consumerComponent));
362
374
  if (populateArtifactsFrom) await updateHiddenProp(scope, populateArtifactsFrom);
@@ -387,6 +399,44 @@ async function tagModelComponent({
387
399
  removedComponents
388
400
  };
389
401
  }
402
+ function addIntegritiesToConsumerComponentsGraphs(packageIntegritiesByPublishedPackages, consumerComponents) {
403
+ const _addIntegritiesToDependenciesGraph = addIntegritiesToDependenciesGraph.bind(null, packageIntegritiesByPublishedPackages);
404
+ for (const consumerComponent of consumerComponents) {
405
+ if (consumerComponent.dependenciesGraph) {
406
+ consumerComponent.dependenciesGraph = _addIntegritiesToDependenciesGraph(consumerComponent.dependenciesGraph);
407
+ }
408
+ }
409
+ }
410
+
411
+ /**
412
+ * Updates the dependencies graph by replacing all "pending" version numbers of component dependencies
413
+ * with the actual version numbers of the recently published packages. It also attaches the integrity
414
+ * checksums of these components to ensure data integrity for each resolved dependency.
415
+ *
416
+ * @param packageIntegritiesByPublishedPackages - A map of package names and versions to their integrity checksums.
417
+ * @param dependenciesGraph - The current dependencies graph, containing nodes with potentially "pending" versions.
418
+ * @returns A new DependenciesGraph with updated versions and integrity checksums for all previously pending dependencies.
419
+ */
420
+ function addIntegritiesToDependenciesGraph(packageIntegritiesByPublishedPackages, dependenciesGraph) {
421
+ const resolvedVersions = [];
422
+ for (const [selector, integrity] of packageIntegritiesByPublishedPackages.entries()) {
423
+ if (integrity == null) continue;
424
+ const index = selector.indexOf('@', 1);
425
+ const name = selector.substring(0, index);
426
+ const version = selector.substring(index + 1);
427
+ const pendingPkg = dependenciesGraph.packages.get(`${name}@pending:`);
428
+ if (pendingPkg) {
429
+ pendingPkg.resolution = {
430
+ integrity
431
+ };
432
+ resolvedVersions.push({
433
+ name,
434
+ version
435
+ });
436
+ }
437
+ }
438
+ return replacePendingVersions(dependenciesGraph, resolvedVersions);
439
+ }
390
440
  async function removeDeletedComponentsFromBitmap(comps, workspace) {
391
441
  if (!workspace) {
392
442
  return undefined;
@@ -548,6 +598,21 @@ async function updateComponentsVersions(workspace, components, isTag = true) {
548
598
  await workspace.scope.legacyScope.stagedSnaps.write();
549
599
  return stagedConfig;
550
600
  }
601
+ function replacePendingVersions(graph, resolvedVersions) {
602
+ let s = graph.serialize();
603
+ for (const {
604
+ name,
605
+ version
606
+ } of resolvedVersions) {
607
+ s = s.replaceAll(`${name}@pending:`, `${name}@${version}`);
608
+ }
609
+ const updatedDependenciesGraph = _dependenciesGraph().DependenciesGraph.deserialize(s);
610
+ // This should never happen as we know at this point that the schema version is supported
611
+ if (updatedDependenciesGraph == null) {
612
+ throw new (_bitError().BitError)('Failed to deserialize dependencies graph in replacePendingVersions()');
613
+ }
614
+ return updatedDependenciesGraph;
615
+ }
551
616
 
552
617
  /**
553
618
  * relevant for "_tag" (tag-from-scope) command.
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_uuid","_bitError","_componentId","_constants","_componentSchema","_workspaceModules","_exceptions","_remove","_logger","_pkgModules","_harmonyModules","_toolboxCrypto","_autoTag","_messagePerComponent","_models","_toolboxPromise","e","__esModule","default","updateDependenciesVersions","allComponentsToTag","dependencyResolver","componentsToTag","filter","c","isRemoved","getNewDependencyVersion","id","foundDependency","find","component","isEqualWithoutVersion","changeVersion","version","changeExtensionsVersion","extensions","forEach","ext","extensionId","newDepId","oneComponentToTag","getAllDependencies","dependency","updateDepsOnLegacyTag","bind","setHashes","componentToTag","setNewVersion","sha1","v4","setFutureVersions","scope","releaseType","exactVersion","persist","autoTagIds","ids","incrementBy","preReleaseId","soft","tagDataPerComp","isPreReleaseLike","includes","Promise","all","map","isAutoTag","hasWithoutVersion","modelComponent","sources","findOrAddComponent","nextVersion","componentMap","getNewVersion","tagData","t","componentId","Error","toStringWithoutVersion","versionToTag","exactVersionOrReleaseType","getValidVersionOrReleaseType","getVersionToAdd","prereleaseId","undefined","preRelease","versionByEnteredId","getVersionByEnteredId","newVersion","enteredIds","enteredId","searchWithoutVersion","hasVersion","tagModelComponent","snapping","consumerComponents","populateArtifactsFrom","populateArtifactsIgnorePkgJson","message","editor","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","build","isSnap","disableTagAndSnapPipelines","ignoreBuildErrors","rebuildDepsGraph","packageManagerConfigRootDir","copyLogFromPreviousSnap","exitOnFirstFailedTask","updateDependentsOnLane","workspace","builder","consumer","legacyScope","consumerComponentsIdsMap","consumerComponent","componentIdString","toString","Object","values","idsToTag","ComponentIdList","fromArray","idsToTriggerAutoTag","autoTagDataWithLocalOnly","getAutoTagInfo","localOnly","listLocalOnly","autoTagData","autoTagItem","autoTagComponents","autoTagComponentsFiltered","has","autoTag","messagesFromEditorFetcher","MessagePerComponentFetcher","getMessagePerId","getMessagesFromEditor","tmp","msg","messagePerId","newestVersionsP","componentFromModel","getModelComponentIfExist","BitError","listVersions","length","latest","getHeadRegardlessOfLaneAsTagOrHash","currentVersion","latestVersion","newestVersions","newestVersionsWithoutEmpty","newest","isEmpty","NewerVersionFound","logger","debugAndAddBreadCrumb","setCurrentSchema","addLogToComponents","unmergedComps","listComponentsDuringMerge","lane","getCurrentLaneObject","stagedConfig","updateNextVersionOnBitmap","_addFlattenedDependenciesToComponents","throwForDepsFromAnotherLane","emptyBuilderData","addBuildStatus","BuildStatus","Pending","addComponentsToScope","Boolean","modelComponents","getModelComponent","updateComponentsVersions","publishedPackages","harmonyComps","onTagOpts","throwOnError","forceDeploy","skipTasksParsed","split","trim","seedersOnly","isolateOptions","builderOptions","componentsToBuild","reloadAspectsWithNewVersion","getManyByLegacy","builderDataMap","tagListener","buildResult","builderDataMapToLegacyOnTagResults","_updateComponentsByTagResult","push","_getPublishedPackages","Succeed","mapSeries","_enrichComp","updateHiddenProp","removedComponents","removeDeletedComponentsFromBitmap","msgStr","laneHistory","lanes","updateLaneHistory","objects","add","removeMergeConfigFromComponents","linkToNodeModulesByComponents","clearObjectsFromCache","taggedComponents","autoTaggedResults","comps","removedComps","comp","compBitIdsToRemove","deleteComponentsFiles","cleanFromBitMap","components","configMergeFile","getConflictMergeFile","compId","isNowSnapped","removeConflict","currentlyUnmerged","hasConflict","write","delete","shouldValidateVersion","results","_addCompToObjects","source","isNew","removeAllParents","clone","existingBuilder","findCoreExtension","Extensions","autoTagComps","messagePerComponent","basicLog","getBasicLog","getLog","msgFromEditor","item","currentLog","log","date","username","email","autoTagComp","defaultMsg","schema","CURRENT_SCHEMA","buildStatus","Skipped","isTag","currentLane","getCurrentLaneId","getStagedConfig","isAvailableOnMain","isDefault","ModelComponent","hasHead","updateVersions","toBitIdWithLatestVersionAllowNull","isOnBitmap","bitMap","getComponentIfExist","ignoreVersion","stagedData","getPerId","config","RemoveAspect","addFromComponentJson","componentMapObject","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","compMapObj","toPlainObject","addComponentConfig","removeConfig","hash","getRef","stagedSnaps","addSnap","getConfigPerId","clearNextVersion","pMapPool","versionObj","getBitObjectVersionById","hidden","addModifiedLog","concurrency"],"sources":["tag-model-component.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { isEmpty } from 'lodash';\nimport { ReleaseType } from 'semver';\nimport { v4 } from 'uuid';\nimport { BitError } from '@teambit/bit-error';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BuildStatus, Extensions } from '@teambit/legacy/dist/constants';\nimport { CURRENT_SCHEMA } from '@teambit/legacy/dist/consumer/component/component-schema';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport Consumer from '@teambit/legacy/dist/consumer/consumer';\nimport { NewerVersionFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { Component } from '@teambit/component';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { getValidVersionOrReleaseType } from '@teambit/pkg.modules.semver-helper';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { AutoTagResult, getAutoTagInfo } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { OnTagOpts } from '@teambit/builder';\nimport { Log } from '@teambit/legacy/dist/scope/models/version';\nimport {\n MessagePerComponent,\n MessagePerComponentFetcher,\n} from '@teambit/legacy/dist/scope/component-ops/message-per-component';\nimport { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ScopeMain, StagedConfig } from '@teambit/scope';\nimport { Workspace } from '@teambit/workspace';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { SnappingMain, TagDataPerComp } from './snapping.main.runtime';\n\nexport type onTagIdTransformer = (id: ComponentID) => ComponentID | null;\n\nexport type BasicTagSnapParams = {\n message: string;\n skipTests?: boolean;\n skipTasks?: string;\n build?: boolean;\n ignoreBuildErrors?: boolean;\n rebuildDepsGraph?: boolean;\n};\n\nexport type BasicTagParams = BasicTagSnapParams & {\n ignoreNewestVersion?: boolean;\n skipAutoTag?: boolean;\n soft?: boolean;\n persist: boolean;\n disableTagAndSnapPipelines?: boolean;\n preReleaseId?: string;\n editor?: string;\n unmodified?: boolean;\n};\n\nfunction updateDependenciesVersions(\n allComponentsToTag: ConsumerComponent[],\n dependencyResolver: DependencyResolverMain\n) {\n // filter out removed components.\n // if a component has a deleted-component as a dependency, it was probably running \"bit install <dep>\" with a version\n // from main. we want to keep it as the user requested. Otherwise, this changes the dependency version to the newly\n // snapped one unintentionally.\n const componentsToTag = allComponentsToTag.filter((c) => !c.isRemoved());\n const getNewDependencyVersion = (id: ComponentID): ComponentID | null => {\n const foundDependency = componentsToTag.find((component) => component.id.isEqualWithoutVersion(id));\n return foundDependency ? id.changeVersion(foundDependency.version) : null;\n };\n const changeExtensionsVersion = (component: ConsumerComponent): void => {\n component.extensions.forEach((ext) => {\n if (ext.extensionId) {\n const newDepId = getNewDependencyVersion(ext.extensionId);\n if (newDepId) ext.extensionId = newDepId;\n }\n });\n };\n\n componentsToTag.forEach((oneComponentToTag) => {\n oneComponentToTag.getAllDependencies().forEach((dependency) => {\n const newDepId = getNewDependencyVersion(dependency.id);\n if (newDepId) dependency.id = newDepId;\n });\n changeExtensionsVersion(oneComponentToTag);\n // @ts-ignore\n oneComponentToTag = dependencyResolver.updateDepsOnLegacyTag(oneComponentToTag, getNewDependencyVersion.bind(this));\n });\n}\n\nfunction setHashes(componentsToTag: ConsumerComponent[]): void {\n componentsToTag.forEach((componentToTag) => {\n componentToTag.setNewVersion(sha1(v4()));\n });\n}\n\nasync function setFutureVersions(\n componentsToTag: ConsumerComponent[],\n scope: Scope,\n releaseType: ReleaseType | undefined,\n exactVersion: string | null | undefined,\n persist: boolean,\n autoTagIds: ComponentIdList,\n ids: ComponentIdList,\n incrementBy?: number,\n preReleaseId?: string,\n soft?: boolean,\n tagDataPerComp?: TagDataPerComp[]\n): Promise<void> {\n const isPreReleaseLike = releaseType\n ? ['prerelease', 'premajor', 'preminor', 'prepatch'].includes(releaseType)\n : false;\n await Promise.all(\n componentsToTag.map(async (componentToTag) => {\n const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);\n const modelComponent = await scope.sources.findOrAddComponent(componentToTag);\n const nextVersion = componentToTag.componentMap?.nextVersion?.version;\n const getNewVersion = (): string => {\n if (tagDataPerComp) {\n const tagData = tagDataPerComp.find((t) => t.componentId.isEqualWithoutVersion(componentToTag.id));\n if (!tagData) throw new Error(`tag-data is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n if (!tagData.versionToTag)\n throw new Error(`tag-data.TagResults is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(tagData.versionToTag);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n incrementBy,\n tagData.prereleaseId\n );\n }\n if (nextVersion && persist) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(nextVersion);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n undefined,\n componentToTag.componentMap?.nextVersion?.preRelease\n );\n }\n if (isAutoTag) {\n // auto-tag always bumped as patch unless it's pre-release\n if (isPreReleaseLike) {\n return soft\n ? (releaseType as string)\n : modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n }\n return soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);\n }\n const versionByEnteredId = getVersionByEnteredId(ids, componentToTag, modelComponent);\n return soft\n ? versionByEnteredId || exactVersion || (releaseType as string)\n : versionByEnteredId || modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n };\n const newVersion = getNewVersion();\n componentToTag.setNewVersion(newVersion);\n })\n );\n}\n\nfunction getVersionByEnteredId(\n enteredIds: ComponentIdList,\n component: ConsumerComponent,\n modelComponent: ModelComponent\n): string | undefined {\n const enteredId = enteredIds.searchWithoutVersion(component.id);\n if (enteredId && enteredId.hasVersion()) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(enteredId.version as string);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion\n );\n }\n return undefined;\n}\n\nexport async function tagModelComponent({\n snapping,\n consumerComponents,\n ids,\n tagDataPerComp,\n populateArtifactsFrom,\n populateArtifactsIgnorePkgJson,\n message,\n editor,\n exactVersion,\n releaseType,\n preReleaseId,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag,\n soft,\n build,\n persist,\n isSnap = false,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n incrementBy,\n packageManagerConfigRootDir,\n copyLogFromPreviousSnap = false,\n exitOnFirstFailedTask = false,\n updateDependentsOnLane = false, // on lane, adds it into updateDependents prop\n}: {\n snapping: SnappingMain;\n consumerComponents: ConsumerComponent[];\n ids: ComponentIdList;\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n populateArtifactsIgnorePkgJson?: boolean;\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n exitOnFirstFailedTask?: boolean;\n updateDependentsOnLane?: boolean;\n} & BasicTagParams): Promise<{\n taggedComponents: ConsumerComponent[];\n autoTaggedResults: AutoTagResult[];\n publishedPackages: string[];\n stagedConfig?: StagedConfig;\n removedComponents?: ComponentIdList;\n}> {\n const workspace = snapping.workspace;\n const scope = snapping.scope;\n const builder = snapping.builder;\n const dependencyResolver = snapping.dependencyResolver;\n\n const consumer = workspace?.consumer;\n const legacyScope = scope.legacyScope;\n const consumerComponentsIdsMap = {};\n // Concat and unique all the dependencies from all the components so we will not import\n // the same dependency more then once, it's mainly for performance purpose\n consumerComponents.forEach((consumerComponent) => {\n const componentIdString = consumerComponent.id.toString();\n // Store it in a map so we can take it easily from the sorted array which contain only the id\n consumerComponentsIdsMap[componentIdString] = consumerComponent;\n });\n const componentsToTag: ConsumerComponent[] = Object.values(consumerComponentsIdsMap); // consumerComponents unique\n const idsToTag = ComponentIdList.fromArray(componentsToTag.map((c) => c.id));\n // ids without versions are new. it's impossible that tagged (and not-modified) components has\n // them as dependencies.\n const idsToTriggerAutoTag = idsToTag.filter((id) => id.hasVersion());\n const autoTagDataWithLocalOnly =\n skipAutoTag || !consumer ? [] : await getAutoTagInfo(consumer, ComponentIdList.fromArray(idsToTriggerAutoTag));\n const localOnly = workspace?.listLocalOnly();\n const autoTagData = localOnly\n ? autoTagDataWithLocalOnly.filter((autoTagItem) => !localOnly.hasWithoutVersion(autoTagItem.component.id))\n : autoTagDataWithLocalOnly;\n const autoTagComponents = autoTagData.map((autoTagItem) => autoTagItem.component);\n const autoTagComponentsFiltered = autoTagComponents.filter((c) => !idsToTag.has(c.id));\n const autoTagIds = ComponentIdList.fromArray(autoTagComponentsFiltered.map((autoTag) => autoTag.id));\n const allComponentsToTag = [...componentsToTag, ...autoTagComponentsFiltered];\n\n const messagesFromEditorFetcher = new MessagePerComponentFetcher(idsToTag, autoTagIds);\n const getMessagePerId = async () => {\n if (editor) return messagesFromEditorFetcher.getMessagesFromEditor(legacyScope.tmp, editor);\n if (tagDataPerComp) return tagDataPerComp.map((t) => ({ id: t.componentId, msg: t.message || message }));\n return [];\n };\n const messagePerId = await getMessagePerId();\n\n // check for each one of the components whether it is using an old version\n if (!ignoreNewestVersion && !isSnap) {\n const newestVersionsP = allComponentsToTag.map(async (component) => {\n if (component.componentFromModel) {\n // otherwise it's a new component, so this check is irrelevant\n const modelComponent = await legacyScope.getModelComponentIfExist(component.id);\n if (!modelComponent) throw new BitError(`component ${component.id} was not found in the model`);\n if (!modelComponent.listVersions().length) return null; // no versions yet, no issues.\n const latest = modelComponent.getHeadRegardlessOfLaneAsTagOrHash();\n if (latest !== component.version) {\n return {\n componentId: component.id.toStringWithoutVersion(),\n currentVersion: component.version,\n latestVersion: latest,\n };\n }\n }\n return null;\n });\n const newestVersions = await Promise.all(newestVersionsP);\n const newestVersionsWithoutEmpty = newestVersions.filter((newest) => newest);\n if (!isEmpty(newestVersionsWithoutEmpty)) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n throw new NewerVersionFound(newestVersionsWithoutEmpty);\n }\n }\n\n logger.debugAndAddBreadCrumb('tag-model-components', 'sequentially persist all components');\n setCurrentSchema(allComponentsToTag);\n // go through all components and find the future versions for them\n isSnap\n ? setHashes(allComponentsToTag)\n : await setFutureVersions(\n allComponentsToTag,\n legacyScope,\n releaseType,\n exactVersion,\n persist,\n autoTagIds,\n ids,\n incrementBy,\n preReleaseId,\n soft,\n tagDataPerComp\n );\n // go through all dependencies and update their versions\n updateDependenciesVersions(allComponentsToTag, dependencyResolver);\n\n await addLogToComponents(componentsToTag, autoTagComponents, persist, message, messagePerId, copyLogFromPreviousSnap);\n // don't move it down. otherwise, it'll be empty and we don't know which components were during merge.\n // (it's being deleted in snapping.main.runtime - `_addCompToObjects` method)\n const unmergedComps = workspace ? await workspace.listComponentsDuringMerge() : [];\n const lane = await legacyScope.getCurrentLaneObject();\n let stagedConfig;\n if (soft) {\n if (!consumer) throw new Error(`unable to soft-tag without consumer`);\n consumer.updateNextVersionOnBitmap(allComponentsToTag, preReleaseId);\n } else {\n await snapping._addFlattenedDependenciesToComponents(allComponentsToTag, rebuildDepsGraph);\n await snapping.throwForDepsFromAnotherLane(allComponentsToTag);\n if (!build) emptyBuilderData(allComponentsToTag);\n addBuildStatus(allComponentsToTag, BuildStatus.Pending);\n await addComponentsToScope(\n snapping,\n allComponentsToTag,\n lane,\n Boolean(build),\n consumer,\n tagDataPerComp,\n updateDependentsOnLane\n );\n\n if (workspace) {\n const modelComponents = await Promise.all(\n allComponentsToTag.map((c) => {\n return c.modelComponent || legacyScope.getModelComponent(c.id);\n })\n );\n stagedConfig = await updateComponentsVersions(workspace, modelComponents);\n }\n }\n\n const publishedPackages: string[] = [];\n let harmonyComps: Component[] = [];\n if (build) {\n const onTagOpts: OnTagOpts = {\n disableTagAndSnapPipelines,\n throwOnError: true,\n forceDeploy: ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n };\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n const seedersOnly = !workspace; // if tag from scope, build only the given components\n const isolateOptions = { packageManagerConfigRootDir, seedersOnly, populateArtifactsIgnorePkgJson };\n const builderOptions = { exitOnFirstFailedTask, skipTests, skipTasks: skipTasksParsed };\n\n const componentsToBuild = allComponentsToTag.filter((c) => !c.isRemoved());\n if (componentsToBuild.length) {\n await scope.reloadAspectsWithNewVersion(componentsToBuild);\n harmonyComps = await (workspace || scope).getManyByLegacy(componentsToBuild);\n const { builderDataMap } = await builder.tagListener(harmonyComps, onTagOpts, isolateOptions, builderOptions);\n const buildResult = scope.builderDataMapToLegacyOnTagResults(builderDataMap);\n\n snapping._updateComponentsByTagResult(componentsToBuild, buildResult);\n publishedPackages.push(...snapping._getPublishedPackages(componentsToBuild));\n addBuildStatus(componentsToBuild, BuildStatus.Succeed);\n await mapSeries(componentsToBuild, (consumerComponent) => snapping._enrichComp(consumerComponent));\n if (populateArtifactsFrom) await updateHiddenProp(scope, populateArtifactsFrom);\n }\n }\n\n let removedComponents: ComponentIdList | undefined;\n if (!soft) {\n removedComponents = await removeDeletedComponentsFromBitmap(allComponentsToTag, workspace);\n if (lane) {\n const msgStr = message ? ` (${message})` : '';\n const laneHistory = await legacyScope.lanes.updateLaneHistory(lane, `snap${msgStr}`);\n legacyScope.objects.add(laneHistory);\n }\n await legacyScope.objects.persist();\n await removeMergeConfigFromComponents(unmergedComps, allComponentsToTag, workspace);\n if (workspace) {\n await linkToNodeModulesByComponents(\n harmonyComps.length ? harmonyComps : await workspace.scope.getManyByLegacy(allComponentsToTag),\n workspace\n );\n }\n }\n\n // clear all objects. otherwise, ModelComponent has the wrong divergeData\n legacyScope.objects.clearObjectsFromCache();\n\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages,\n stagedConfig,\n removedComponents,\n };\n}\n\nasync function removeDeletedComponentsFromBitmap(\n comps: ConsumerComponent[],\n workspace?: Workspace\n): Promise<ComponentIdList | undefined> {\n if (!workspace) {\n return undefined;\n }\n const removedComps = comps.filter((comp) => comp.isRemoved());\n if (!removedComps.length) return undefined;\n const compBitIdsToRemove = ComponentIdList.fromArray(removedComps.map((c) => c.id));\n await deleteComponentsFiles(workspace.consumer, compBitIdsToRemove);\n await workspace.consumer.cleanFromBitMap(compBitIdsToRemove);\n\n return compBitIdsToRemove;\n}\n\nasync function removeMergeConfigFromComponents(\n unmergedComps: ComponentID[],\n components: ConsumerComponent[],\n workspace?: Workspace\n) {\n if (!workspace || !unmergedComps.length) {\n return;\n }\n const configMergeFile = workspace.getConflictMergeFile();\n\n unmergedComps.forEach((compId) => {\n const isNowSnapped = components.find((c) => c.id.isEqualWithoutVersion(compId));\n if (isNowSnapped) {\n configMergeFile.removeConflict(compId.toStringWithoutVersion());\n }\n });\n const currentlyUnmerged = workspace ? await workspace.listComponentsDuringMerge() : [];\n if (configMergeFile.hasConflict() && currentlyUnmerged.length) {\n // it's possible that \"workspace\" section is still there. but if all \"unmerged\" are now merged,\n // then, it's safe to delete the file.\n await configMergeFile.write();\n } else {\n await configMergeFile.delete();\n }\n}\n\nasync function addComponentsToScope(\n snapping: SnappingMain,\n components: ConsumerComponent[],\n lane: Lane | undefined,\n shouldValidateVersion: boolean,\n consumer?: Consumer,\n tagDataPerComp?: TagDataPerComp[],\n updateDependentsOnLane?: boolean\n) {\n await mapSeries(components, async (component) => {\n const results = await snapping._addCompToObjects({\n source: component,\n lane,\n shouldValidateVersion,\n updateDependentsOnLane,\n });\n if (!consumer) {\n const tagData = tagDataPerComp?.find((t) => t.componentId.isEqualWithoutVersion(component.id));\n if (tagData?.isNew) results.version.removeAllParents();\n }\n });\n}\n\n/**\n * otherwise, tagging without build will have the old build data of the previous snap/tag.\n * in case we currently build, it's ok to leave the data as is, because it'll be overridden anyway.\n */\nfunction emptyBuilderData(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.extensions = component.extensions.clone();\n const existingBuilder = component.extensions.findCoreExtension(Extensions.builder);\n if (existingBuilder) existingBuilder.data = {};\n });\n}\n\nasync function addLogToComponents(\n components: ConsumerComponent[],\n autoTagComps: ConsumerComponent[],\n persist: boolean,\n message: string,\n messagePerComponent: MessagePerComponent[],\n copyLogFromPreviousSnap = false\n) {\n // @ts-ignore this happens when running `bit tag -m \"\"`.\n if (message === true) {\n message = '';\n }\n const basicLog = await getBasicLog();\n const getLog = (component: ConsumerComponent): Log => {\n const nextVersion = persist ? component.componentMap?.nextVersion : null;\n const msgFromEditor = messagePerComponent.find((item) => item.id.isEqualWithoutVersion(component.id))?.msg;\n if (copyLogFromPreviousSnap) {\n const currentLog = component.log;\n if (!currentLog) {\n throw new Error(\n `addLogToComponents is set copyLogFromPreviousSnap: true, but it is unable to find log in the previous snap`\n );\n }\n currentLog.message = msgFromEditor || message || currentLog.message;\n currentLog.date = basicLog.date;\n return currentLog;\n }\n\n return {\n username: nextVersion?.username || basicLog.username,\n email: nextVersion?.email || basicLog.email,\n message: nextVersion?.message || msgFromEditor || message,\n date: basicLog.date,\n };\n };\n\n components.forEach((component) => {\n component.log = getLog(component);\n });\n autoTagComps.forEach((autoTagComp) => {\n autoTagComp.log = getLog(autoTagComp);\n const defaultMsg = 'bump dependencies versions';\n if (message) {\n autoTagComp.log.message += ` (${defaultMsg})`;\n } else if (!autoTagComp.log.message) {\n autoTagComp.log.message = defaultMsg;\n }\n });\n}\n\nexport type BitCloudUser = {\n username?: string;\n name?: string;\n displayName?: string;\n profileImage?: string;\n};\n\nfunction setCurrentSchema(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.schema = CURRENT_SCHEMA;\n });\n}\n\nfunction addBuildStatus(components: ConsumerComponent[], buildStatus: BuildStatus) {\n components.forEach((component) => {\n component.buildStatus = component.isRemoved() ? BuildStatus.Skipped : buildStatus;\n });\n}\n\nexport async function updateComponentsVersions(\n workspace: Workspace,\n components: Array<ModelComponent>,\n isTag = true\n): Promise<StagedConfig> {\n const consumer = workspace.consumer;\n const currentLane = consumer.getCurrentLaneId();\n const stagedConfig = await workspace.scope.getStagedConfig();\n const isAvailableOnMain = async (\n component: ModelComponent | ConsumerComponent,\n id: ComponentID\n ): Promise<boolean> => {\n if (currentLane.isDefault()) {\n return true;\n }\n if (!id.hasVersion()) {\n // component was unsnapped on the current lane and is back to a new component\n return true;\n }\n const modelComponent =\n component instanceof ModelComponent ? component : await consumer.scope.getModelComponent(component.id);\n return modelComponent.hasHead();\n };\n\n const updateVersions = async (modelComponent: ModelComponent) => {\n const id: ComponentID = modelComponent.toBitIdWithLatestVersionAllowNull();\n const isOnBitmap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion: true });\n if (!isOnBitmap && !isTag) {\n // handle the case when a component was deleted, snapped/tagged and is now reset.\n const stagedData = stagedConfig.getPerId(id);\n if (stagedData?.config && stagedData.config[RemoveAspect.id]) {\n consumer.bitMap.addFromComponentJson(stagedData.id, stagedData.componentMapObject);\n }\n }\n consumer.bitMap.updateComponentId(id, undefined, undefined, true);\n const availableOnMain = await isAvailableOnMain(modelComponent, id);\n if (!availableOnMain) {\n consumer.bitMap.setOnLanesOnly(id, true);\n }\n const componentMap = consumer.bitMap.getComponent(id);\n const compId = await workspace.resolveComponentId(id);\n // it can be either a tag/snap or reset.\n if (isTag) {\n const compMapObj = componentMap.toPlainObject();\n const config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config, compMapObj);\n consumer.bitMap.removeConfig(id);\n const hash = modelComponent.getRef(id.version as string);\n if (!hash) throw new Error(`updateComponentsVersions: unable to find a hash for ${id.toString()}`);\n workspace.scope.legacyScope.stagedSnaps.addSnap(hash?.toString());\n } else if (!componentMap.config) {\n componentMap.config = stagedConfig.getConfigPerId(compId);\n }\n componentMap.clearNextVersion();\n };\n // * the comment below is probably not relevant anymore, but it's good to keep it for future reference. *\n // important! DO NOT use Promise.all here! otherwise, you're gonna enter into a whole world of pain.\n // imagine tagging comp1 with auto-tagged comp2, comp1 package.json is written while comp2 is\n // trying to get the dependencies of comp1 using its package.json.\n await mapSeries(components, updateVersions);\n await workspace.scope.legacyScope.stagedSnaps.write();\n\n return stagedConfig;\n}\n\n/**\n * relevant for \"_tag\" (tag-from-scope) command.\n * the new tag uses the same files/config/build-artifacts as the previous snap.\n * we want to mark the previous snap as hidden. so then \"bit log\" and \"bit blame\" won't show it.\n */\nasync function updateHiddenProp(scope: ScopeMain, ids: ComponentID[]) {\n const log = await getBasicLog();\n log.message = 'marked as hidden';\n await pMapPool(\n ids,\n async (id) => {\n const versionObj = await scope.getBitObjectVersionById(id);\n if (!versionObj) return;\n versionObj.hidden = true;\n versionObj.addModifiedLog(log);\n scope.legacyScope.objects.add(versionObj);\n },\n { concurrency: 50 }\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,iBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,gBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,kBAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,iBAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,I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,MAAO7B,EAAE,IAAK;IACZ,MAAM+Q,UAAU,GAAG,MAAMvP,KAAK,CAACwP,uBAAuB,CAAChR,EAAE,CAAC;IAC1D,IAAI,CAAC+Q,UAAU,EAAE;IACjBA,UAAU,CAACE,MAAM,GAAG,IAAI;IACxBF,UAAU,CAACG,cAAc,CAACjD,GAAG,CAAC;IAC9BzM,KAAK,CAACiE,WAAW,CAAC+F,OAAO,CAACC,GAAG,CAACsF,UAAU,CAAC;EAC3C,CAAC,EACD;IAAEI,WAAW,EAAE;EAAG,CACpB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_uuid","_bitError","_componentId","_constants","_componentSchema","_workspaceModules","_exceptions","_remove","_logger","_pkgModules","_harmonyModules","_toolboxCrypto","_autoTag","_dependenciesGraph","_messagePerComponent","_models","_toolboxPromise","e","__esModule","default","updateDependenciesVersions","allComponentsToTag","dependencyResolver","componentsToTag","filter","c","isRemoved","getNewDependencyVersion","id","foundDependency","find","component","isEqualWithoutVersion","changeVersion","version","changeExtensionsVersion","extensions","forEach","ext","extensionId","newDepId","oneComponentToTag","getAllDependencies","dependency","updateDepsOnLegacyTag","bind","setHashes","componentToTag","setNewVersion","sha1","v4","setFutureVersions","scope","releaseType","exactVersion","persist","autoTagIds","ids","incrementBy","preReleaseId","soft","tagDataPerComp","isPreReleaseLike","includes","Promise","all","map","isAutoTag","hasWithoutVersion","modelComponent","sources","findOrAddComponent","nextVersion","componentMap","getNewVersion","tagData","t","componentId","Error","toStringWithoutVersion","versionToTag","exactVersionOrReleaseType","getValidVersionOrReleaseType","getVersionToAdd","prereleaseId","undefined","preRelease","versionByEnteredId","getVersionByEnteredId","newVersion","enteredIds","enteredId","searchWithoutVersion","hasVersion","tagModelComponent","snapping","consumerComponents","components","populateArtifactsFrom","populateArtifactsIgnorePkgJson","message","editor","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","build","isSnap","disableTagAndSnapPipelines","ignoreBuildErrors","rebuildDepsGraph","packageManagerConfigRootDir","copyLogFromPreviousSnap","exitOnFirstFailedTask","updateDependentsOnLane","workspace","builder","consumer","legacyScope","consumerComponentsIdsMap","consumerComponent","componentIdString","toString","Object","values","idsToTag","ComponentIdList","fromArray","idsToTriggerAutoTag","autoTagDataWithLocalOnly","getAutoTagInfo","localOnly","listLocalOnly","autoTagData","autoTagItem","autoTagComponents","autoTagComponentsFiltered","has","autoTag","messagesFromEditorFetcher","MessagePerComponentFetcher","getMessagePerId","getMessagesFromEditor","tmp","msg","messagePerId","newestVersionsP","componentFromModel","getModelComponentIfExist","BitError","listVersions","length","latest","getHeadRegardlessOfLaneAsTagOrHash","currentVersion","latestVersion","newestVersions","newestVersionsWithoutEmpty","newest","isEmpty","NewerVersionFound","logger","debugAndAddBreadCrumb","setCurrentSchema","addLogToComponents","unmergedComps","listComponentsDuringMerge","lane","getCurrentLaneObject","stagedConfig","updateNextVersionOnBitmap","_addFlattenedDependenciesToComponents","_addDependenciesGraphToComponents","throwForDepsFromAnotherLane","emptyBuilderData","addBuildStatus","BuildStatus","Pending","addComponentsToScope","Boolean","modelComponents","getModelComponent","updateComponentsVersions","publishedPackages","harmonyComps","onTagOpts","throwOnError","forceDeploy","skipTasksParsed","split","trim","seedersOnly","isolateOptions","builderOptions","componentsToBuild","reloadAspectsWithNewVersion","getManyByLegacy","builderDataMap","tagListener","buildResult","builderDataMapToLegacyOnTagResults","_updateComponentsByTagResult","packageIntegritiesByPublishedPackages","_getPublishedPackages","push","Array","from","keys","addIntegritiesToConsumerComponentsGraphs","Succeed","mapSeries","_enrichComp","updateHiddenProp","removedComponents","removeDeletedComponentsFromBitmap","msgStr","laneHistory","lanes","updateLaneHistory","objects","add","removeMergeConfigFromComponents","linkToNodeModulesByComponents","clearObjectsFromCache","taggedComponents","autoTaggedResults","_addIntegritiesToDependenciesGraph","addIntegritiesToDependenciesGraph","dependenciesGraph","resolvedVersions","selector","integrity","entries","index","indexOf","name","substring","pendingPkg","packages","get","resolution","replacePendingVersions","comps","removedComps","comp","compBitIdsToRemove","deleteComponentsFiles","cleanFromBitMap","configMergeFile","getConflictMergeFile","compId","isNowSnapped","removeConflict","currentlyUnmerged","hasConflict","write","delete","shouldValidateVersion","results","_addCompToObjects","source","isNew","removeAllParents","clone","existingBuilder","findCoreExtension","Extensions","autoTagComps","messagePerComponent","basicLog","getBasicLog","getLog","msgFromEditor","item","currentLog","log","date","username","email","autoTagComp","defaultMsg","schema","CURRENT_SCHEMA","buildStatus","Skipped","isTag","currentLane","getCurrentLaneId","getStagedConfig","isAvailableOnMain","isDefault","ModelComponent","hasHead","updateVersions","toBitIdWithLatestVersionAllowNull","isOnBitmap","bitMap","getComponentIfExist","ignoreVersion","stagedData","getPerId","config","RemoveAspect","addFromComponentJson","componentMapObject","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","compMapObj","toPlainObject","addComponentConfig","removeConfig","hash","getRef","stagedSnaps","addSnap","getConfigPerId","clearNextVersion","graph","s","serialize","replaceAll","updatedDependenciesGraph","DependenciesGraph","deserialize","pMapPool","versionObj","getBitObjectVersionById","hidden","addModifiedLog","concurrency"],"sources":["tag-model-component.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { isEmpty } from 'lodash';\nimport { ReleaseType } from 'semver';\nimport { v4 } from 'uuid';\nimport { BitError } from '@teambit/bit-error';\nimport { Scope } from '@teambit/legacy/dist/scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BuildStatus, Extensions } from '@teambit/legacy/dist/constants';\nimport { CURRENT_SCHEMA } from '@teambit/legacy/dist/consumer/component/component-schema';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport Consumer from '@teambit/legacy/dist/consumer/consumer';\nimport { NewerVersionFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { Component } from '@teambit/component';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { getValidVersionOrReleaseType } from '@teambit/pkg.modules.semver-helper';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { AutoTagResult, getAutoTagInfo } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { OnTagOpts } from '@teambit/builder';\nimport { DependenciesGraph } from '@teambit/legacy/dist/scope/models/dependencies-graph';\nimport { Log } from '@teambit/legacy/dist/scope/models/version';\nimport {\n MessagePerComponent,\n MessagePerComponentFetcher,\n} from '@teambit/legacy/dist/scope/component-ops/message-per-component';\nimport { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ScopeMain, StagedConfig } from '@teambit/scope';\nimport { Workspace } from '@teambit/workspace';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { PackageIntegritiesByPublishedPackages, SnappingMain, TagDataPerComp } from './snapping.main.runtime';\n\nexport type onTagIdTransformer = (id: ComponentID) => ComponentID | null;\n\nexport type BasicTagSnapParams = {\n message: string;\n skipTests?: boolean;\n skipTasks?: string;\n build?: boolean;\n ignoreBuildErrors?: boolean;\n rebuildDepsGraph?: boolean;\n};\n\nexport type BasicTagParams = BasicTagSnapParams & {\n ignoreNewestVersion?: boolean;\n skipAutoTag?: boolean;\n soft?: boolean;\n persist: boolean;\n disableTagAndSnapPipelines?: boolean;\n preReleaseId?: string;\n editor?: string;\n unmodified?: boolean;\n};\n\nfunction updateDependenciesVersions(\n allComponentsToTag: ConsumerComponent[],\n dependencyResolver: DependencyResolverMain\n) {\n // filter out removed components.\n // if a component has a deleted-component as a dependency, it was probably running \"bit install <dep>\" with a version\n // from main. we want to keep it as the user requested. Otherwise, this changes the dependency version to the newly\n // snapped one unintentionally.\n const componentsToTag = allComponentsToTag.filter((c) => !c.isRemoved());\n const getNewDependencyVersion = (id: ComponentID): ComponentID | null => {\n const foundDependency = componentsToTag.find((component) => component.id.isEqualWithoutVersion(id));\n return foundDependency ? id.changeVersion(foundDependency.version) : null;\n };\n const changeExtensionsVersion = (component: ConsumerComponent): void => {\n component.extensions.forEach((ext) => {\n if (ext.extensionId) {\n const newDepId = getNewDependencyVersion(ext.extensionId);\n if (newDepId) ext.extensionId = newDepId;\n }\n });\n };\n\n componentsToTag.forEach((oneComponentToTag) => {\n oneComponentToTag.getAllDependencies().forEach((dependency) => {\n const newDepId = getNewDependencyVersion(dependency.id);\n if (newDepId) dependency.id = newDepId;\n });\n changeExtensionsVersion(oneComponentToTag);\n // @ts-ignore\n oneComponentToTag = dependencyResolver.updateDepsOnLegacyTag(oneComponentToTag, getNewDependencyVersion.bind(this));\n });\n}\n\nfunction setHashes(componentsToTag: ConsumerComponent[]): void {\n componentsToTag.forEach((componentToTag) => {\n componentToTag.setNewVersion(sha1(v4()));\n });\n}\n\nasync function setFutureVersions(\n componentsToTag: ConsumerComponent[],\n scope: Scope,\n releaseType: ReleaseType | undefined,\n exactVersion: string | null | undefined,\n persist: boolean,\n autoTagIds: ComponentIdList,\n ids: ComponentIdList,\n incrementBy?: number,\n preReleaseId?: string,\n soft?: boolean,\n tagDataPerComp?: TagDataPerComp[]\n): Promise<void> {\n const isPreReleaseLike = releaseType\n ? ['prerelease', 'premajor', 'preminor', 'prepatch'].includes(releaseType)\n : false;\n await Promise.all(\n componentsToTag.map(async (componentToTag) => {\n const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);\n const modelComponent = await scope.sources.findOrAddComponent(componentToTag);\n const nextVersion = componentToTag.componentMap?.nextVersion?.version;\n const getNewVersion = (): string => {\n if (tagDataPerComp) {\n const tagData = tagDataPerComp.find((t) => t.componentId.isEqualWithoutVersion(componentToTag.id));\n if (!tagData) throw new Error(`tag-data is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n if (!tagData.versionToTag)\n throw new Error(`tag-data.TagResults is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(tagData.versionToTag);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n incrementBy,\n tagData.prereleaseId\n );\n }\n if (nextVersion && persist) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(nextVersion);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n undefined,\n componentToTag.componentMap?.nextVersion?.preRelease\n );\n }\n if (isAutoTag) {\n // auto-tag always bumped as patch unless it's pre-release\n if (isPreReleaseLike) {\n return soft\n ? (releaseType as string)\n : modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n }\n return soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);\n }\n const versionByEnteredId = getVersionByEnteredId(ids, componentToTag, modelComponent);\n return soft\n ? versionByEnteredId || exactVersion || (releaseType as string)\n : versionByEnteredId || modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n };\n const newVersion = getNewVersion();\n componentToTag.setNewVersion(newVersion);\n })\n );\n}\n\nfunction getVersionByEnteredId(\n enteredIds: ComponentIdList,\n component: ConsumerComponent,\n modelComponent: ModelComponent\n): string | undefined {\n const enteredId = enteredIds.searchWithoutVersion(component.id);\n if (enteredId && enteredId.hasVersion()) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(enteredId.version as string);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion\n );\n }\n return undefined;\n}\n\nexport async function tagModelComponent({\n snapping,\n consumerComponents,\n components,\n ids,\n tagDataPerComp,\n populateArtifactsFrom,\n populateArtifactsIgnorePkgJson,\n message,\n editor,\n exactVersion,\n releaseType,\n preReleaseId,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag,\n soft,\n build,\n persist,\n isSnap = false,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n incrementBy,\n packageManagerConfigRootDir,\n copyLogFromPreviousSnap = false,\n exitOnFirstFailedTask = false,\n updateDependentsOnLane = false, // on lane, adds it into updateDependents prop\n}: {\n snapping: SnappingMain;\n components: Component[];\n consumerComponents: ConsumerComponent[];\n ids: ComponentIdList;\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n populateArtifactsIgnorePkgJson?: boolean;\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n exitOnFirstFailedTask?: boolean;\n updateDependentsOnLane?: boolean;\n} & BasicTagParams): Promise<{\n taggedComponents: ConsumerComponent[];\n autoTaggedResults: AutoTagResult[];\n publishedPackages: string[];\n stagedConfig?: StagedConfig;\n removedComponents?: ComponentIdList;\n}> {\n const workspace = snapping.workspace;\n const scope = snapping.scope;\n const builder = snapping.builder;\n const dependencyResolver = snapping.dependencyResolver;\n\n const consumer = workspace?.consumer;\n const legacyScope = scope.legacyScope;\n const consumerComponentsIdsMap = {};\n // Concat and unique all the dependencies from all the components so we will not import\n // the same dependency more then once, it's mainly for performance purpose\n consumerComponents.forEach((consumerComponent) => {\n const componentIdString = consumerComponent.id.toString();\n // Store it in a map so we can take it easily from the sorted array which contain only the id\n consumerComponentsIdsMap[componentIdString] = consumerComponent;\n });\n const componentsToTag: ConsumerComponent[] = Object.values(consumerComponentsIdsMap); // consumerComponents unique\n const idsToTag = ComponentIdList.fromArray(componentsToTag.map((c) => c.id));\n // ids without versions are new. it's impossible that tagged (and not-modified) components has\n // them as dependencies.\n const idsToTriggerAutoTag = idsToTag.filter((id) => id.hasVersion());\n const autoTagDataWithLocalOnly =\n skipAutoTag || !consumer ? [] : await getAutoTagInfo(consumer, ComponentIdList.fromArray(idsToTriggerAutoTag));\n const localOnly = workspace?.listLocalOnly();\n const autoTagData = localOnly\n ? autoTagDataWithLocalOnly.filter((autoTagItem) => !localOnly.hasWithoutVersion(autoTagItem.component.id))\n : autoTagDataWithLocalOnly;\n const autoTagComponents = autoTagData.map((autoTagItem) => autoTagItem.component);\n const autoTagComponentsFiltered = autoTagComponents.filter((c) => !idsToTag.has(c.id));\n const autoTagIds = ComponentIdList.fromArray(autoTagComponentsFiltered.map((autoTag) => autoTag.id));\n const allComponentsToTag = [...componentsToTag, ...autoTagComponentsFiltered];\n\n const messagesFromEditorFetcher = new MessagePerComponentFetcher(idsToTag, autoTagIds);\n const getMessagePerId = async () => {\n if (editor) return messagesFromEditorFetcher.getMessagesFromEditor(legacyScope.tmp, editor);\n if (tagDataPerComp) return tagDataPerComp.map((t) => ({ id: t.componentId, msg: t.message || message }));\n return [];\n };\n const messagePerId = await getMessagePerId();\n\n // check for each one of the components whether it is using an old version\n if (!ignoreNewestVersion && !isSnap) {\n const newestVersionsP = allComponentsToTag.map(async (component) => {\n if (component.componentFromModel) {\n // otherwise it's a new component, so this check is irrelevant\n const modelComponent = await legacyScope.getModelComponentIfExist(component.id);\n if (!modelComponent) throw new BitError(`component ${component.id} was not found in the model`);\n if (!modelComponent.listVersions().length) return null; // no versions yet, no issues.\n const latest = modelComponent.getHeadRegardlessOfLaneAsTagOrHash();\n if (latest !== component.version) {\n return {\n componentId: component.id.toStringWithoutVersion(),\n currentVersion: component.version,\n latestVersion: latest,\n };\n }\n }\n return null;\n });\n const newestVersions = await Promise.all(newestVersionsP);\n const newestVersionsWithoutEmpty = newestVersions.filter((newest) => newest);\n if (!isEmpty(newestVersionsWithoutEmpty)) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n throw new NewerVersionFound(newestVersionsWithoutEmpty);\n }\n }\n\n logger.debugAndAddBreadCrumb('tag-model-components', 'sequentially persist all components');\n setCurrentSchema(allComponentsToTag);\n\n // go through all components and find the future versions for them\n isSnap\n ? setHashes(allComponentsToTag)\n : await setFutureVersions(\n allComponentsToTag,\n legacyScope,\n releaseType,\n exactVersion,\n persist,\n autoTagIds,\n ids,\n incrementBy,\n preReleaseId,\n soft,\n tagDataPerComp\n );\n // go through all dependencies and update their versions\n updateDependenciesVersions(allComponentsToTag, dependencyResolver);\n\n await addLogToComponents(componentsToTag, autoTagComponents, persist, message, messagePerId, copyLogFromPreviousSnap);\n // don't move it down. otherwise, it'll be empty and we don't know which components were during merge.\n // (it's being deleted in snapping.main.runtime - `_addCompToObjects` method)\n const unmergedComps = workspace ? await workspace.listComponentsDuringMerge() : [];\n const lane = await legacyScope.getCurrentLaneObject();\n let stagedConfig;\n if (soft) {\n if (!consumer) throw new Error(`unable to soft-tag without consumer`);\n consumer.updateNextVersionOnBitmap(allComponentsToTag, preReleaseId);\n } else {\n await snapping._addFlattenedDependenciesToComponents(allComponentsToTag, rebuildDepsGraph);\n await snapping._addDependenciesGraphToComponents(components);\n await snapping.throwForDepsFromAnotherLane(allComponentsToTag);\n if (!build) emptyBuilderData(allComponentsToTag);\n addBuildStatus(allComponentsToTag, BuildStatus.Pending);\n await addComponentsToScope(\n snapping,\n allComponentsToTag,\n lane,\n Boolean(build),\n consumer,\n tagDataPerComp,\n updateDependentsOnLane\n );\n\n if (workspace) {\n const modelComponents = await Promise.all(\n allComponentsToTag.map((c) => {\n return c.modelComponent || legacyScope.getModelComponent(c.id);\n })\n );\n stagedConfig = await updateComponentsVersions(workspace, modelComponents);\n }\n }\n\n const publishedPackages: string[] = [];\n let harmonyComps: Component[] = [];\n if (build) {\n const onTagOpts: OnTagOpts = {\n disableTagAndSnapPipelines,\n throwOnError: true,\n forceDeploy: ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n };\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n const seedersOnly = !workspace; // if tag from scope, build only the given components\n const isolateOptions = { packageManagerConfigRootDir, seedersOnly, populateArtifactsIgnorePkgJson };\n const builderOptions = { exitOnFirstFailedTask, skipTests, skipTasks: skipTasksParsed };\n\n const componentsToBuild = allComponentsToTag.filter((c) => !c.isRemoved());\n if (componentsToBuild.length) {\n await scope.reloadAspectsWithNewVersion(componentsToBuild);\n harmonyComps = await (workspace || scope).getManyByLegacy(componentsToBuild);\n const { builderDataMap } = await builder.tagListener(harmonyComps, onTagOpts, isolateOptions, builderOptions);\n const buildResult = scope.builderDataMapToLegacyOnTagResults(builderDataMap);\n\n snapping._updateComponentsByTagResult(componentsToBuild, buildResult);\n const packageIntegritiesByPublishedPackages = snapping._getPublishedPackages(componentsToBuild);\n publishedPackages.push(...Array.from(packageIntegritiesByPublishedPackages.keys()));\n\n addIntegritiesToConsumerComponentsGraphs(packageIntegritiesByPublishedPackages, allComponentsToTag);\n addBuildStatus(componentsToBuild, BuildStatus.Succeed);\n await mapSeries(componentsToBuild, (consumerComponent) => snapping._enrichComp(consumerComponent));\n if (populateArtifactsFrom) await updateHiddenProp(scope, populateArtifactsFrom);\n }\n }\n\n let removedComponents: ComponentIdList | undefined;\n if (!soft) {\n removedComponents = await removeDeletedComponentsFromBitmap(allComponentsToTag, workspace);\n if (lane) {\n const msgStr = message ? ` (${message})` : '';\n const laneHistory = await legacyScope.lanes.updateLaneHistory(lane, `snap${msgStr}`);\n legacyScope.objects.add(laneHistory);\n }\n await legacyScope.objects.persist();\n await removeMergeConfigFromComponents(unmergedComps, allComponentsToTag, workspace);\n if (workspace) {\n await linkToNodeModulesByComponents(\n harmonyComps.length ? harmonyComps : await workspace.scope.getManyByLegacy(allComponentsToTag),\n workspace\n );\n }\n }\n\n // clear all objects. otherwise, ModelComponent has the wrong divergeData\n legacyScope.objects.clearObjectsFromCache();\n\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages,\n stagedConfig,\n removedComponents,\n };\n}\n\nfunction addIntegritiesToConsumerComponentsGraphs(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n consumerComponents: ConsumerComponent[]\n) {\n const _addIntegritiesToDependenciesGraph = addIntegritiesToDependenciesGraph.bind(\n null,\n packageIntegritiesByPublishedPackages\n );\n for (const consumerComponent of consumerComponents) {\n if (consumerComponent.dependenciesGraph) {\n consumerComponent.dependenciesGraph = _addIntegritiesToDependenciesGraph(consumerComponent.dependenciesGraph);\n }\n }\n}\n\n/**\n * Updates the dependencies graph by replacing all \"pending\" version numbers of component dependencies\n * with the actual version numbers of the recently published packages. It also attaches the integrity\n * checksums of these components to ensure data integrity for each resolved dependency.\n *\n * @param packageIntegritiesByPublishedPackages - A map of package names and versions to their integrity checksums.\n * @param dependenciesGraph - The current dependencies graph, containing nodes with potentially \"pending\" versions.\n * @returns A new DependenciesGraph with updated versions and integrity checksums for all previously pending dependencies.\n */\nfunction addIntegritiesToDependenciesGraph(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n dependenciesGraph: DependenciesGraph\n): DependenciesGraph {\n const resolvedVersions: Array<{ name: string; version: string }> = [];\n for (const [selector, integrity] of packageIntegritiesByPublishedPackages.entries()) {\n if (integrity == null) continue;\n const index = selector.indexOf('@', 1);\n const name = selector.substring(0, index);\n const version = selector.substring(index + 1);\n const pendingPkg = dependenciesGraph.packages.get(`${name}@pending:`);\n if (pendingPkg) {\n pendingPkg.resolution = { integrity };\n resolvedVersions.push({ name, version });\n }\n }\n return replacePendingVersions(dependenciesGraph, resolvedVersions) as DependenciesGraph;\n}\n\nasync function removeDeletedComponentsFromBitmap(\n comps: ConsumerComponent[],\n workspace?: Workspace\n): Promise<ComponentIdList | undefined> {\n if (!workspace) {\n return undefined;\n }\n const removedComps = comps.filter((comp) => comp.isRemoved());\n if (!removedComps.length) return undefined;\n const compBitIdsToRemove = ComponentIdList.fromArray(removedComps.map((c) => c.id));\n await deleteComponentsFiles(workspace.consumer, compBitIdsToRemove);\n await workspace.consumer.cleanFromBitMap(compBitIdsToRemove);\n\n return compBitIdsToRemove;\n}\n\nasync function removeMergeConfigFromComponents(\n unmergedComps: ComponentID[],\n components: ConsumerComponent[],\n workspace?: Workspace\n) {\n if (!workspace || !unmergedComps.length) {\n return;\n }\n const configMergeFile = workspace.getConflictMergeFile();\n\n unmergedComps.forEach((compId) => {\n const isNowSnapped = components.find((c) => c.id.isEqualWithoutVersion(compId));\n if (isNowSnapped) {\n configMergeFile.removeConflict(compId.toStringWithoutVersion());\n }\n });\n const currentlyUnmerged = workspace ? await workspace.listComponentsDuringMerge() : [];\n if (configMergeFile.hasConflict() && currentlyUnmerged.length) {\n // it's possible that \"workspace\" section is still there. but if all \"unmerged\" are now merged,\n // then, it's safe to delete the file.\n await configMergeFile.write();\n } else {\n await configMergeFile.delete();\n }\n}\n\nasync function addComponentsToScope(\n snapping: SnappingMain,\n components: ConsumerComponent[],\n lane: Lane | undefined,\n shouldValidateVersion: boolean,\n consumer?: Consumer,\n tagDataPerComp?: TagDataPerComp[],\n updateDependentsOnLane?: boolean\n) {\n await mapSeries(components, async (component) => {\n const results = await snapping._addCompToObjects({\n source: component,\n lane,\n shouldValidateVersion,\n updateDependentsOnLane,\n });\n if (!consumer) {\n const tagData = tagDataPerComp?.find((t) => t.componentId.isEqualWithoutVersion(component.id));\n if (tagData?.isNew) results.version.removeAllParents();\n }\n });\n}\n\n/**\n * otherwise, tagging without build will have the old build data of the previous snap/tag.\n * in case we currently build, it's ok to leave the data as is, because it'll be overridden anyway.\n */\nfunction emptyBuilderData(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.extensions = component.extensions.clone();\n const existingBuilder = component.extensions.findCoreExtension(Extensions.builder);\n if (existingBuilder) existingBuilder.data = {};\n });\n}\n\nasync function addLogToComponents(\n components: ConsumerComponent[],\n autoTagComps: ConsumerComponent[],\n persist: boolean,\n message: string,\n messagePerComponent: MessagePerComponent[],\n copyLogFromPreviousSnap = false\n) {\n // @ts-ignore this happens when running `bit tag -m \"\"`.\n if (message === true) {\n message = '';\n }\n const basicLog = await getBasicLog();\n const getLog = (component: ConsumerComponent): Log => {\n const nextVersion = persist ? component.componentMap?.nextVersion : null;\n const msgFromEditor = messagePerComponent.find((item) => item.id.isEqualWithoutVersion(component.id))?.msg;\n if (copyLogFromPreviousSnap) {\n const currentLog = component.log;\n if (!currentLog) {\n throw new Error(\n `addLogToComponents is set copyLogFromPreviousSnap: true, but it is unable to find log in the previous snap`\n );\n }\n currentLog.message = msgFromEditor || message || currentLog.message;\n currentLog.date = basicLog.date;\n return currentLog;\n }\n\n return {\n username: nextVersion?.username || basicLog.username,\n email: nextVersion?.email || basicLog.email,\n message: nextVersion?.message || msgFromEditor || message,\n date: basicLog.date,\n };\n };\n\n components.forEach((component) => {\n component.log = getLog(component);\n });\n autoTagComps.forEach((autoTagComp) => {\n autoTagComp.log = getLog(autoTagComp);\n const defaultMsg = 'bump dependencies versions';\n if (message) {\n autoTagComp.log.message += ` (${defaultMsg})`;\n } else if (!autoTagComp.log.message) {\n autoTagComp.log.message = defaultMsg;\n }\n });\n}\n\nexport type BitCloudUser = {\n username?: string;\n name?: string;\n displayName?: string;\n profileImage?: string;\n};\n\nfunction setCurrentSchema(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.schema = CURRENT_SCHEMA;\n });\n}\n\nfunction addBuildStatus(components: ConsumerComponent[], buildStatus: BuildStatus) {\n components.forEach((component) => {\n component.buildStatus = component.isRemoved() ? BuildStatus.Skipped : buildStatus;\n });\n}\n\nexport async function updateComponentsVersions(\n workspace: Workspace,\n components: Array<ModelComponent>,\n isTag = true\n): Promise<StagedConfig> {\n const consumer = workspace.consumer;\n const currentLane = consumer.getCurrentLaneId();\n const stagedConfig = await workspace.scope.getStagedConfig();\n const isAvailableOnMain = async (\n component: ModelComponent | ConsumerComponent,\n id: ComponentID\n ): Promise<boolean> => {\n if (currentLane.isDefault()) {\n return true;\n }\n if (!id.hasVersion()) {\n // component was unsnapped on the current lane and is back to a new component\n return true;\n }\n const modelComponent =\n component instanceof ModelComponent ? component : await consumer.scope.getModelComponent(component.id);\n return modelComponent.hasHead();\n };\n\n const updateVersions = async (modelComponent: ModelComponent) => {\n const id: ComponentID = modelComponent.toBitIdWithLatestVersionAllowNull();\n const isOnBitmap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion: true });\n if (!isOnBitmap && !isTag) {\n // handle the case when a component was deleted, snapped/tagged and is now reset.\n const stagedData = stagedConfig.getPerId(id);\n if (stagedData?.config && stagedData.config[RemoveAspect.id]) {\n consumer.bitMap.addFromComponentJson(stagedData.id, stagedData.componentMapObject);\n }\n }\n consumer.bitMap.updateComponentId(id, undefined, undefined, true);\n const availableOnMain = await isAvailableOnMain(modelComponent, id);\n if (!availableOnMain) {\n consumer.bitMap.setOnLanesOnly(id, true);\n }\n const componentMap = consumer.bitMap.getComponent(id);\n const compId = await workspace.resolveComponentId(id);\n // it can be either a tag/snap or reset.\n if (isTag) {\n const compMapObj = componentMap.toPlainObject();\n const config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config, compMapObj);\n consumer.bitMap.removeConfig(id);\n const hash = modelComponent.getRef(id.version as string);\n if (!hash) throw new Error(`updateComponentsVersions: unable to find a hash for ${id.toString()}`);\n workspace.scope.legacyScope.stagedSnaps.addSnap(hash?.toString());\n } else if (!componentMap.config) {\n componentMap.config = stagedConfig.getConfigPerId(compId);\n }\n componentMap.clearNextVersion();\n };\n // * the comment below is probably not relevant anymore, but it's good to keep it for future reference. *\n // important! DO NOT use Promise.all here! otherwise, you're gonna enter into a whole world of pain.\n // imagine tagging comp1 with auto-tagged comp2, comp1 package.json is written while comp2 is\n // trying to get the dependencies of comp1 using its package.json.\n await mapSeries(components, updateVersions);\n await workspace.scope.legacyScope.stagedSnaps.write();\n\n return stagedConfig;\n}\n\nfunction replacePendingVersions(\n graph: DependenciesGraph,\n resolvedVersions: Array<{ name: string; version: string }>\n): DependenciesGraph {\n let s = graph.serialize();\n for (const { name, version } of resolvedVersions) {\n s = s.replaceAll(`${name}@pending:`, `${name}@${version}`);\n }\n const updatedDependenciesGraph = DependenciesGraph.deserialize(s);\n // This should never happen as we know at this point that the schema version is supported\n if (updatedDependenciesGraph == null) {\n throw new BitError('Failed to deserialize dependencies graph in replacePendingVersions()');\n }\n return updatedDependenciesGraph;\n}\n\n/**\n * relevant for \"_tag\" (tag-from-scope) command.\n * the new tag uses the same files/config/build-artifacts as the previous snap.\n * we want to mark the previous snap as hidden. so then \"bit log\" and \"bit blame\" won't show it.\n */\nasync function updateHiddenProp(scope: ScopeMain, ids: ComponentID[]) {\n const log = await getBasicLog();\n log.message = 'marked as hidden';\n await pMapPool(\n ids,\n async (id) => {\n const versionObj = await scope.getBitObjectVersionById(id);\n if (!versionObj) return;\n versionObj.hidden = true;\n versionObj.addModifiedLog(log);\n scope.legacyScope.objects.add(versionObj);\n },\n { concurrency: 50 }\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAA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Ac,CAACxD,GAAG,CAAC;IAC9B/N,KAAK,CAACkE,WAAW,CAACqG,OAAO,CAACC,GAAG,CAAC4G,UAAU,CAAC;EAC3C,CAAC,EACD;IAAEI,WAAW,EAAE;EAAG,CACpB,CAAC;AACH","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/snapping",
3
- "version": "1.0.480",
3
+ "version": "1.0.482",
4
4
  "homepage": "https://bit.cloud/teambit/component/snapping",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "snapping",
9
- "version": "1.0.480"
9
+ "version": "1.0.482"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -22,34 +22,34 @@
22
22
  "@teambit/harmony": "0.4.6",
23
23
  "@teambit/component-version": "1.0.3",
24
24
  "@teambit/lane-id": "0.0.311",
25
- "@teambit/graph": "1.0.480",
26
- "@teambit/logger": "0.0.1150",
27
- "@teambit/scope": "1.0.480",
25
+ "@teambit/graph": "1.0.482",
26
+ "@teambit/logger": "0.0.1152",
27
+ "@teambit/scope": "1.0.482",
28
28
  "@teambit/toolbox.promise.map-pool": "0.0.1",
29
- "@teambit/component.sources": "0.0.49",
30
- "@teambit/component": "1.0.480",
31
- "@teambit/dependencies": "1.0.480",
32
- "@teambit/dependency-resolver": "1.0.480",
33
- "@teambit/cli": "0.0.1057",
34
- "@teambit/legacy.component-list": "0.0.51",
35
- "@teambit/remove": "1.0.480",
29
+ "@teambit/component.sources": "0.0.50",
30
+ "@teambit/component": "1.0.482",
31
+ "@teambit/dependencies": "1.0.482",
32
+ "@teambit/dependency-resolver": "1.0.482",
33
+ "@teambit/cli": "0.0.1059",
34
+ "@teambit/legacy.component-list": "0.0.52",
35
+ "@teambit/remove": "1.0.482",
36
36
  "@teambit/component-issues": "0.0.151",
37
- "@teambit/global-config": "0.0.1060",
38
- "@teambit/application": "1.0.480",
39
- "@teambit/builder": "1.0.480",
40
- "@teambit/export": "1.0.480",
37
+ "@teambit/global-config": "0.0.1062",
38
+ "@teambit/application": "1.0.482",
39
+ "@teambit/builder": "1.0.482",
40
+ "@teambit/export": "1.0.482",
41
41
  "@teambit/harmony.modules.concurrency": "0.0.1",
42
- "@teambit/importer": "1.0.480",
43
- "@teambit/insights": "1.0.480",
44
- "@teambit/issues": "1.0.480",
45
- "@teambit/lanes.modules.create-lane": "0.0.31",
42
+ "@teambit/importer": "1.0.482",
43
+ "@teambit/insights": "1.0.482",
44
+ "@teambit/issues": "1.0.482",
45
+ "@teambit/lanes.modules.create-lane": "0.0.32",
46
46
  "@teambit/legacy.scope-api": "0.0.52",
47
47
  "@teambit/pkg.modules.semver-helper": "0.0.1",
48
- "@teambit/workspace": "1.0.480",
48
+ "@teambit/workspace": "1.0.482",
49
49
  "@teambit/bit.get-bit-version": "0.0.1",
50
50
  "@teambit/harmony.modules.get-basic-log": "0.0.1",
51
51
  "@teambit/toolbox.crypto.sha1": "0.0.2",
52
- "@teambit/workspace.modules.node-modules-linker": "0.0.225"
52
+ "@teambit/workspace.modules.node-modules-linker": "0.0.226"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/lodash": "4.14.165",
@@ -58,10 +58,10 @@
58
58
  "chai": "4.3.0",
59
59
  "@types/uuid": "8.3.4",
60
60
  "@types/mocha": "9.1.0",
61
- "@teambit/harmony.envs.core-aspect-env": "0.0.62",
62
- "@teambit/compiler": "1.0.480",
63
- "@teambit/component.testing.mock-components": "0.0.256",
64
- "@teambit/harmony.testing.load-aspect": "0.0.251",
61
+ "@teambit/harmony.envs.core-aspect-env": "0.0.63",
62
+ "@teambit/compiler": "1.0.482",
63
+ "@teambit/component.testing.mock-components": "0.0.257",
64
+ "@teambit/harmony.testing.load-aspect": "0.0.252",
65
65
  "@teambit/workspace.testing.mock-workspace": "0.0.27"
66
66
  },
67
67
  "peerDependencies": {