@teambit/snapping 1.0.347 → 1.0.348

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.
@@ -266,16 +266,31 @@ describe('Snapping aspect', function () {
266
266
  const taggedNames = tagResults?.snappedComponents.map(c => c.name);
267
267
  (0, _chai().expect)(taggedNames).to.not.include('comp1');
268
268
  });
269
- it('should never be exported even when tagged with --include-local-only', async () => {
269
+ it('should be ignored when it is an auto-tag candidate', async () => {
270
270
  const snapping = harmony.get(_snapping().SnappingAspect.id);
271
+ await snapping.tag({
272
+ unmodified: true
273
+ });
271
274
  const tagResults = await snapping.tag({
272
- unmodified: true,
273
- includeLocalOnly: true
275
+ ids: ['comp3'],
276
+ unmodified: true
274
277
  });
275
- (0, _chai().expect)(tagResults?.taggedComponents).to.have.lengthOf(3);
276
- const exportAspect = harmony.get(_export().ExportAspect.id);
277
- const result = await exportAspect.export();
278
- (0, _chai().expect)(result.componentsIds).to.have.lengthOf(2);
278
+ (0, _chai().expect)(tagResults?.autoTaggedResults).to.have.lengthOf(1); // only comp3 should be auto-tagged
279
+ const taggedNames = tagResults?.autoTaggedResults.map(c => c.component.name);
280
+ (0, _chai().expect)(taggedNames).to.not.include('comp1');
281
+ });
282
+ it('should block setting local-only when a component is staged', async () => {
283
+ const snapping = harmony.get(_snapping().SnappingAspect.id);
284
+ await snapping.tag({
285
+ unmodified: true
286
+ });
287
+ const comp2Id = await workspace.idsByPattern('comp2');
288
+ try {
289
+ await workspace.setLocalOnly(comp2Id);
290
+ _chai().expect.fail('should have thrown an error');
291
+ } catch (err) {
292
+ (0, _chai().expect)(err.message).to.include('unable to set the following component(s) as local-only');
293
+ }
279
294
  });
280
295
  });
281
296
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_path","_harmonyTesting","_workspaceTesting","_issues","_scope","_export","_compiler","_objects","_componentTesting","_snapping","_workspace","e","__esModule","default","describe","timeout","workspaceData","snapping","before","mockWorkspace","workspacePath","console","log","mockComponents","fs","writeFile","path","join","compiler","loadAspect","CompilerAspect","compileOnWorkspace","SnappingAspect","it","tag","ids","err","expect","constructor","name","to","equal","skip","setWorkspaceConfig","IssuesAspect","id","ignoreIssues","results","taggedComponents","length","after","destroyWorkspace","snappedId","harmonyBareScope","harmony","loadManyAspects","ExportAspect","get","snap","pattern","build","message","exportMain","export","bareScope","mockBareScope","remoteScopePath","ScopeAspect","scopePath","snappingScope","snapDataPerComp","componentId","remoteScopeName","newDependencies","version","isComponent","type","snapFromScope","snappedIds","snapHash","scope","versionObj","legacyScope","objects","load","Ref","from","devPackages","Object","keys","devPackageDependencies","include","numOfComponents","removeDependencies","dependencies","have","lengthOf","workspace","WorkspaceAspect","comp1Id","idsByPattern","setLocalOnly","list","listLocalOnly","toString","tagResults","taggedNames","map","c","not","unmodified","snappedComponents","includeLocalOnly","exportAspect","result","componentsIds"],"sources":["snapping.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { Harmony } from '@teambit/harmony';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport {\n mockWorkspace,\n mockBareScope,\n destroyWorkspace,\n WorkspaceData,\n setWorkspaceConfig,\n} from '@teambit/workspace.testing.mock-workspace';\nimport { IssuesAspect } from '@teambit/issues';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ComponentID } from '@teambit/component-id';\nimport { Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { SnappingAspect } from './snapping.aspect';\nimport { SnapDataPerCompRaw } from './snap-from-scope.cmd';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\n\ndescribe('Snapping aspect', function () {\n this.timeout(0);\n\n describe('components with issues', () => {\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n await mockComponents(workspacePath);\n await fs.writeFile(path.join(workspacePath, 'comp1/index.js'), `const nonExist = require(\"non-exist\");`);\n const compiler: CompilerMain = await loadAspect(CompilerAspect, workspacePath);\n await compiler.compileOnWorkspace();\n snapping = await loadAspect(SnappingAspect, workspacePath);\n });\n it('tag should throw an ComponentsHaveIssues error', async () => {\n try {\n await snapping.tag({ ids: ['comp1'] });\n } catch (err: any) {\n expect(err.constructor.name).to.equal('ComponentsHaveIssues');\n }\n });\n // @todo: this test fails during \"bit build\" for some reason. It passes on \"bit test\";\n it.skip('should not throw an error if the config was set to ignore MissingPackagesDependenciesOnFs error', async () => {\n await setWorkspaceConfig(workspaceData.workspacePath, IssuesAspect.id, {\n ignoreIssues: ['MissingPackagesDependenciesOnFs'],\n });\n snapping = await loadAspect(SnappingAspect, workspaceData.workspacePath);\n const results = await snapping.tag({ ids: ['comp1'] });\n expect(results?.taggedComponents.length).to.equal(1);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('snap from scope an existing component with newDependencies prop populated', () => {\n let workspaceData: WorkspaceData;\n let snappedId: ComponentID;\n let harmonyBareScope: Harmony;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n const harmony = await loadManyAspects([SnappingAspect, ExportAspect], workspacePath);\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.snap({ pattern: 'comp1', build: false, message: 'first snap' });\n const exportMain = harmony.get<ExportMain>(ExportAspect.id);\n await exportMain.export();\n\n const bareScope = mockBareScope(workspaceData.remoteScopePath, 'bare-for-snap');\n harmonyBareScope = await loadManyAspects([SnappingAspect, ScopeAspect], bareScope.scopePath);\n const snappingScope = harmonyBareScope.get<SnappingMain>(SnappingAspect.id);\n const snapDataPerComp: SnapDataPerCompRaw[] = [\n {\n componentId: `${workspaceData.remoteScopeName}/comp1`,\n message: 'snap from scope',\n newDependencies: [\n {\n id: 'lodash',\n version: '4.1.2',\n isComponent: false,\n type: 'dev',\n },\n ],\n },\n ];\n const results = await snappingScope.snapFromScope(snapDataPerComp, {});\n\n snappedId = results.snappedIds[0];\n });\n it('should add the new dev dep', async () => {\n const snapHash = snappedId.version;\n const scope = harmonyBareScope.get<ScopeMain>(ScopeAspect.id);\n const versionObj = (await scope.legacyScope.objects.load(Ref.from(snapHash))) as Version;\n const devPackages = Object.keys(versionObj.devPackageDependencies);\n expect(devPackages).to.include('lodash');\n\n // also, it should not delete other dev-deps that were there before.\n expect(devPackages).to.include('@types/node');\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('snap from scope - remove existing dependency', () => {\n let workspaceData: WorkspaceData;\n let snappedId: ComponentID;\n let harmonyBareScope: Harmony;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath, { numOfComponents: 2 });\n const harmony = await loadManyAspects([SnappingAspect, ExportAspect], workspacePath);\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.snap({ build: false, message: 'first snap' });\n const exportMain = harmony.get<ExportMain>(ExportAspect.id);\n await exportMain.export();\n\n const bareScope = mockBareScope(workspaceData.remoteScopePath, 'bare-for-snap');\n harmonyBareScope = await loadManyAspects([SnappingAspect, ScopeAspect], bareScope.scopePath);\n const snappingScope = harmonyBareScope.get<SnappingMain>(SnappingAspect.id);\n const snapDataPerComp: SnapDataPerCompRaw[] = [\n {\n componentId: `${workspaceData.remoteScopeName}/comp1`,\n message: 'snap from scope',\n removeDependencies: [`${workspaceData.remoteScopeName}/comp2`],\n },\n ];\n // console.log('snapDataPerComp', JSON.stringify(snapDataPerComp));\n const results = await snappingScope.snapFromScope(snapDataPerComp, {});\n\n snappedId = results.snappedIds[0];\n });\n it('should remove the specified dependency', async () => {\n const snapHash = snappedId.version;\n const scope = harmonyBareScope.get<ScopeMain>(ScopeAspect.id);\n const versionObj = (await scope.legacyScope.objects.load(Ref.from(snapHash))) as Version;\n expect(versionObj.dependencies.get()).to.have.lengthOf(0);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('local-only', () => {\n let harmony: Harmony;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath, { numOfComponents: 3 });\n harmony = await loadManyAspects([WorkspaceAspect, SnappingAspect], workspacePath);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n const comp1Id = await workspace.idsByPattern('comp1');\n await workspace.setLocalOnly(comp1Id);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should be able to list it', async () => {\n const list = workspace.listLocalOnly();\n expect(list).to.have.lengthOf(1);\n expect(list[0].toString()).to.include('comp1');\n });\n it('should be ignored by tag command', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n const tagResults = await snapping.tag({});\n expect(tagResults?.taggedComponents).to.have.lengthOf(2);\n const taggedNames = tagResults?.taggedComponents.map((c) => c.name);\n expect(taggedNames).to.not.include('comp1');\n });\n it('should be ignored by snap command', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n const tagResults = await snapping.snap({ unmodified: true });\n expect(tagResults?.snappedComponents).to.have.lengthOf(2);\n const taggedNames = tagResults?.snappedComponents.map((c) => c.name);\n expect(taggedNames).to.not.include('comp1');\n });\n it('should never be exported even when tagged with --include-local-only', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n const tagResults = await snapping.tag({ unmodified: true, includeLocalOnly: true });\n expect(tagResults?.taggedComponents).to.have.lengthOf(3);\n\n const exportAspect = harmony.get<ExportMain>(ExportAspect.id);\n const result = await exportAspect.export();\n expect(result.componentsIds).to.have.lengthOf(2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AG,MAAMxF,QAAQ,CAACiB,GAAG,CAAC;QAAE4E,UAAU,EAAE,IAAI;QAAEE,gBAAgB,EAAE;MAAK,CAAC,CAAC;MACnF,IAAA3E,cAAM,EAACoE,UAAU,EAAEzD,gBAAgB,CAAC,CAACR,EAAE,CAACuD,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;MAExD,MAAMiB,YAAY,GAAG3D,OAAO,CAACG,GAAG,CAAaD,sBAAY,CAACX,EAAE,CAAC;MAC7D,MAAMqE,MAAM,GAAG,MAAMD,YAAY,CAAClD,MAAM,CAAC,CAAC;MAC1C,IAAA1B,cAAM,EAAC6E,MAAM,CAACC,aAAa,CAAC,CAAC3E,EAAE,CAACuD,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_path","_harmonyTesting","_workspaceTesting","_issues","_scope","_export","_compiler","_objects","_componentTesting","_snapping","_workspace","e","__esModule","default","describe","timeout","workspaceData","snapping","before","mockWorkspace","workspacePath","console","log","mockComponents","fs","writeFile","path","join","compiler","loadAspect","CompilerAspect","compileOnWorkspace","SnappingAspect","it","tag","ids","err","expect","constructor","name","to","equal","skip","setWorkspaceConfig","IssuesAspect","id","ignoreIssues","results","taggedComponents","length","after","destroyWorkspace","snappedId","harmonyBareScope","harmony","loadManyAspects","ExportAspect","get","snap","pattern","build","message","exportMain","export","bareScope","mockBareScope","remoteScopePath","ScopeAspect","scopePath","snappingScope","snapDataPerComp","componentId","remoteScopeName","newDependencies","version","isComponent","type","snapFromScope","snappedIds","snapHash","scope","versionObj","legacyScope","objects","load","Ref","from","devPackages","Object","keys","devPackageDependencies","include","numOfComponents","removeDependencies","dependencies","have","lengthOf","workspace","WorkspaceAspect","comp1Id","idsByPattern","setLocalOnly","list","listLocalOnly","toString","tagResults","taggedNames","map","c","not","unmodified","snappedComponents","autoTaggedResults","component","comp2Id","fail"],"sources":["snapping.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { Harmony } from '@teambit/harmony';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport {\n mockWorkspace,\n mockBareScope,\n destroyWorkspace,\n WorkspaceData,\n setWorkspaceConfig,\n} from '@teambit/workspace.testing.mock-workspace';\nimport { IssuesAspect } from '@teambit/issues';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ComponentID } from '@teambit/component-id';\nimport { Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { SnappingAspect } from './snapping.aspect';\nimport { SnapDataPerCompRaw } from './snap-from-scope.cmd';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\n\ndescribe('Snapping aspect', function () {\n this.timeout(0);\n\n describe('components with issues', () => {\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n await mockComponents(workspacePath);\n await fs.writeFile(path.join(workspacePath, 'comp1/index.js'), `const nonExist = require(\"non-exist\");`);\n const compiler: CompilerMain = await loadAspect(CompilerAspect, workspacePath);\n await compiler.compileOnWorkspace();\n snapping = await loadAspect(SnappingAspect, workspacePath);\n });\n it('tag should throw an ComponentsHaveIssues error', async () => {\n try {\n await snapping.tag({ ids: ['comp1'] });\n } catch (err: any) {\n expect(err.constructor.name).to.equal('ComponentsHaveIssues');\n }\n });\n // @todo: this test fails during \"bit build\" for some reason. It passes on \"bit test\";\n it.skip('should not throw an error if the config was set to ignore MissingPackagesDependenciesOnFs error', async () => {\n await setWorkspaceConfig(workspaceData.workspacePath, IssuesAspect.id, {\n ignoreIssues: ['MissingPackagesDependenciesOnFs'],\n });\n snapping = await loadAspect(SnappingAspect, workspaceData.workspacePath);\n const results = await snapping.tag({ ids: ['comp1'] });\n expect(results?.taggedComponents.length).to.equal(1);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('snap from scope an existing component with newDependencies prop populated', () => {\n let workspaceData: WorkspaceData;\n let snappedId: ComponentID;\n let harmonyBareScope: Harmony;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n const harmony = await loadManyAspects([SnappingAspect, ExportAspect], workspacePath);\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.snap({ pattern: 'comp1', build: false, message: 'first snap' });\n const exportMain = harmony.get<ExportMain>(ExportAspect.id);\n await exportMain.export();\n\n const bareScope = mockBareScope(workspaceData.remoteScopePath, 'bare-for-snap');\n harmonyBareScope = await loadManyAspects([SnappingAspect, ScopeAspect], bareScope.scopePath);\n const snappingScope = harmonyBareScope.get<SnappingMain>(SnappingAspect.id);\n const snapDataPerComp: SnapDataPerCompRaw[] = [\n {\n componentId: `${workspaceData.remoteScopeName}/comp1`,\n message: 'snap from scope',\n newDependencies: [\n {\n id: 'lodash',\n version: '4.1.2',\n isComponent: false,\n type: 'dev',\n },\n ],\n },\n ];\n const results = await snappingScope.snapFromScope(snapDataPerComp, {});\n\n snappedId = results.snappedIds[0];\n });\n it('should add the new dev dep', async () => {\n const snapHash = snappedId.version;\n const scope = harmonyBareScope.get<ScopeMain>(ScopeAspect.id);\n const versionObj = (await scope.legacyScope.objects.load(Ref.from(snapHash))) as Version;\n const devPackages = Object.keys(versionObj.devPackageDependencies);\n expect(devPackages).to.include('lodash');\n\n // also, it should not delete other dev-deps that were there before.\n expect(devPackages).to.include('@types/node');\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('snap from scope - remove existing dependency', () => {\n let workspaceData: WorkspaceData;\n let snappedId: ComponentID;\n let harmonyBareScope: Harmony;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath, { numOfComponents: 2 });\n const harmony = await loadManyAspects([SnappingAspect, ExportAspect], workspacePath);\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.snap({ build: false, message: 'first snap' });\n const exportMain = harmony.get<ExportMain>(ExportAspect.id);\n await exportMain.export();\n\n const bareScope = mockBareScope(workspaceData.remoteScopePath, 'bare-for-snap');\n harmonyBareScope = await loadManyAspects([SnappingAspect, ScopeAspect], bareScope.scopePath);\n const snappingScope = harmonyBareScope.get<SnappingMain>(SnappingAspect.id);\n const snapDataPerComp: SnapDataPerCompRaw[] = [\n {\n componentId: `${workspaceData.remoteScopeName}/comp1`,\n message: 'snap from scope',\n removeDependencies: [`${workspaceData.remoteScopeName}/comp2`],\n },\n ];\n // console.log('snapDataPerComp', JSON.stringify(snapDataPerComp));\n const results = await snappingScope.snapFromScope(snapDataPerComp, {});\n\n snappedId = results.snappedIds[0];\n });\n it('should remove the specified dependency', async () => {\n const snapHash = snappedId.version;\n const scope = harmonyBareScope.get<ScopeMain>(ScopeAspect.id);\n const versionObj = (await scope.legacyScope.objects.load(Ref.from(snapHash))) as Version;\n expect(versionObj.dependencies.get()).to.have.lengthOf(0);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n describe('local-only', () => {\n let harmony: Harmony;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath, { numOfComponents: 3 });\n harmony = await loadManyAspects([WorkspaceAspect, SnappingAspect], workspacePath);\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n const comp1Id = await workspace.idsByPattern('comp1');\n await workspace.setLocalOnly(comp1Id);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should be able to list it', async () => {\n const list = workspace.listLocalOnly();\n expect(list).to.have.lengthOf(1);\n expect(list[0].toString()).to.include('comp1');\n });\n it('should be ignored by tag command', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n const tagResults = await snapping.tag({});\n expect(tagResults?.taggedComponents).to.have.lengthOf(2);\n const taggedNames = tagResults?.taggedComponents.map((c) => c.name);\n expect(taggedNames).to.not.include('comp1');\n });\n it('should be ignored by snap command', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n const tagResults = await snapping.snap({ unmodified: true });\n expect(tagResults?.snappedComponents).to.have.lengthOf(2);\n const taggedNames = tagResults?.snappedComponents.map((c) => c.name);\n expect(taggedNames).to.not.include('comp1');\n });\n it('should be ignored when it is an auto-tag candidate', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.tag({ unmodified: true });\n const tagResults = await snapping.tag({ ids: ['comp3'], unmodified: true });\n expect(tagResults?.autoTaggedResults).to.have.lengthOf(1); // only comp3 should be auto-tagged\n const taggedNames = tagResults?.autoTaggedResults.map((c) => c.component.name);\n expect(taggedNames).to.not.include('comp1');\n });\n it('should block setting local-only when a component is staged', async () => {\n const snapping = harmony.get<SnappingMain>(SnappingAspect.id);\n await snapping.tag({ unmodified: true });\n const comp2Id = await workspace.idsByPattern('comp2');\n try {\n await workspace.setLocalOnly(comp2Id);\n expect.fail('should have thrown an error');\n } catch (err: any) {\n expect(err.message).to.include('unable to set the following component(s) as local-only');\n }\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,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AC,CAAC;MAC3D,MAAMU,WAAW,GAAGD,UAAU,EAAEO,iBAAiB,CAACL,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACK,SAAS,CAAC1E,IAAI,CAAC;MAC9E,IAAAF,cAAM,EAACqE,WAAW,CAAC,CAAClE,EAAE,CAACqE,GAAG,CAAClB,OAAO,CAAC,OAAO,CAAC;IAC7C,CAAC,CAAC;IACF1D,EAAE,CAAC,4DAA4D,EAAE,YAAY;MAC3E,MAAMhB,QAAQ,GAAGqC,OAAO,CAACG,GAAG,CAAezB,0BAAc,CAACa,EAAE,CAAC;MAC7D,MAAM5B,QAAQ,CAACiB,GAAG,CAAC;QAAE4E,UAAU,EAAE;MAAK,CAAC,CAAC;MACxC,MAAMI,OAAO,GAAG,MAAMjB,SAAS,CAACG,YAAY,CAAC,OAAO,CAAC;MACrD,IAAI;QACF,MAAMH,SAAS,CAACI,YAAY,CAACa,OAAO,CAAC;QACrC7E,cAAM,CAAC8E,IAAI,CAAC,6BAA6B,CAAC;MAC5C,CAAC,CAAC,OAAO/E,GAAQ,EAAE;QACjB,IAAAC,cAAM,EAACD,GAAG,CAACyB,OAAO,CAAC,CAACrB,EAAE,CAACmD,OAAO,CAAC,wDAAwD,CAAC;MAC1F;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
package/dist/tag-cmd.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare class TagCmd implements Command {
29
29
  description: string;
30
30
  }[];
31
31
  constructor(snapping: SnappingMain, logger: Logger, globalConfig: GlobalConfigMain);
32
- report([patterns]: [string[]], { message, ver, editor, snapped, unmerged, patch, minor, major, preRelease, increment, prereleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, unmodified, build, soft, persist, disableTagPipeline, forceDeploy, ignoreBuildErrors, rebuildDepsGraph, failFast, incrementBy, includeLocalOnly, }: {
32
+ report([patterns]: [string[]], { message, ver, editor, snapped, unmerged, patch, minor, major, preRelease, increment, prereleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, unmodified, build, soft, persist, disableTagPipeline, forceDeploy, ignoreBuildErrors, rebuildDepsGraph, failFast, incrementBy, }: {
33
33
  snapped?: boolean;
34
34
  unmerged?: boolean;
35
35
  ver?: string;
package/dist/tag-cmd.js CHANGED
@@ -60,7 +60,7 @@ if patterns are entered, you can specify a version per pattern using "@" sign, e
60
60
  _defineProperty(this, "options", [['m', 'message <message>', 'a log message describing latest changes'], ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'], ['', 'editor [editor]', 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).'], ['v', 'ver <version>', 'tag with the given version'], ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`], ['', 'prerelease-id <id>', 'prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")'], ['p', 'patch', 'syntactic sugar for "--increment patch"'], ['', 'minor', 'syntactic sugar for "--increment minor"'], ['', 'major', 'syntactic sugar for "--increment major"'], ['', 'pre-release [identifier]', 'syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`'], ['', 'snapped', 'tag only components whose head is a snap (not a tag)'], ['', 'unmerged', 'complete a merge process by tagging the unmerged components'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-tasks <string>', `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.
61
61
  specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)`], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist [skip-build]', 'persist the changes generated by --soft tag. by default, run the build pipeline, unless "skip-build" is provided'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'DEPRECATED. use --ignore-build-error instead'], ['', 'ignore-build-errors', 'proceed to tag pipeline even when build pipeline fails'], ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.'], ['i', 'ignore-issues <issues>', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
62
62
  [${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
63
- to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['I', 'ignore-newest-version', 'allow tagging even when the component has newer versions e.g. for hotfixes (default = false)'], ['', 'fail-fast', 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)'], ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the tag'], ['', 'include-local-only', 'include local-only components in the tag process']]);
63
+ to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['I', 'ignore-newest-version', 'allow tagging even when the component has newer versions e.g. for hotfixes (default = false)'], ['', 'fail-fast', 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)'], ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the tag']]);
64
64
  _defineProperty(this, "remoteOp", true);
65
65
  // In case a compiler / tester is not installed
66
66
  _defineProperty(this, "examples", [{
@@ -96,8 +96,7 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
96
96
  ignoreBuildErrors = false,
97
97
  rebuildDepsGraph,
98
98
  failFast = false,
99
- incrementBy = 1,
100
- includeLocalOnly
99
+ incrementBy = 1
101
100
  }) {
102
101
  if (!message && !persist && !editor) {
103
102
  this.logger.consoleWarning(`--message will be mandatory in the next few releases. make sure to add a message with your tag`);
@@ -171,8 +170,7 @@ To undo local tag use the "bit reset" command.`);
171
170
  rebuildDepsGraph,
172
171
  incrementBy,
173
172
  version: ver,
174
- failFast,
175
- includeLocalOnly
173
+ failFast
176
174
  };
177
175
  const results = await this.snapping.tag(params);
178
176
  if (!results) return _chalk().default.yellow(persist ? 'no soft-tag found' : NOTHING_TO_TAG_MSG);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","_componentIssues","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","NOTHING_TO_TAG_MSG","exports","AUTO_TAGGED_MSG","RELEASE_TYPES","TagCmd","constructor","snapping","logger","globalConfig","name","description","COMPONENT_PATTERN_HELP","join","keys","IssuesClasses","cmd","report","patterns","message","ver","editor","snapped","unmerged","patch","minor","major","preRelease","increment","prereleaseId","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","build","soft","persist","disableTagPipeline","forceDeploy","ignoreBuildErrors","rebuildDepsGraph","failFast","incrementBy","includeLocalOnly","consoleWarning","BitError","releaseFlags","filter","x","length","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","disableTagAndSnapPipelines","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","params","ids","releaseType","preReleaseId","version","results","tag","chalk","yellow","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","compInBold","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","softTagPrefix","outputIfExists","label","explanation","components","underline","newDesc","changedDesc","softTagClarification","outputIdsIfExists"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport {\n DEFAULT_BIT_RELEASE_TYPE,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TagResults, SnappingMain } from './snapping.main.runtime';\nimport { BasicTagParams } from './tag-model-component';\n\nexport const NOTHING_TO_TAG_MSG = 'nothing to tag';\nexport const AUTO_TAGGED_MSG = 'auto-tagged dependents';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'development';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'a log message describing latest changes'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\n ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'tag only components whose head is a snap (not a tag)'],\n ['', 'unmerged', 'complete a merge process by tagging the unmerged components'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n [\n '',\n 'persist [skip-build]',\n 'persist the changes generated by --soft tag. by default, run the build pipeline, unless \"skip-build\" is provided',\n ],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'force-deploy', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'proceed to tag pipeline even when build pipeline fails'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n 'I',\n 'ignore-newest-version',\n 'allow tagging even when the component has newer versions e.g. for hotfixes (default = false)',\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the tag'],\n ['', 'include-local-only', 'include local-only components in the tag process'],\n ] as CommandOptions;\n remoteOp = true; // In case a compiler / tester is not installed\n examples = [{ cmd: 'tag --ver 1.0.0', description: 'tag all components to version 1.0.0' }];\n\n constructor(private snapping: SnappingMain, private logger: Logger, private globalConfig: GlobalConfigMain) {}\n\n // eslint-disable-next-line complexity\n async report(\n [patterns = []]: [string[]],\n {\n message = '',\n ver,\n editor = '',\n snapped = false,\n unmerged = false,\n patch,\n minor,\n major,\n preRelease,\n increment,\n prereleaseId,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag = false,\n unmodified = false,\n build,\n soft = false,\n persist = false,\n disableTagPipeline = false,\n forceDeploy = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n failFast = false,\n incrementBy = 1,\n includeLocalOnly,\n }: {\n snapped?: boolean;\n unmerged?: boolean;\n ver?: string;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n forceDeploy?: boolean;\n } & Partial<BasicTagParams>\n ): Promise<string> {\n if (!message && !persist && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your tag`\n );\n }\n if (prereleaseId && (!increment || increment === 'major' || increment === 'minor' || increment === 'patch')) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment flag, while --increment must be one of the following: [prepatch, prerelease, preminor, premajor]`\n );\n }\n if (forceDeploy) {\n this.logger.consoleWarning(`--force-deploy is deprecated, use --ignore-build-errors instead`);\n ignoreBuildErrors = true;\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\n semver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return increment;\n }\n if (major) return 'major';\n if (minor) return 'minor';\n if (patch) return 'patch';\n if (preRelease) return 'prerelease';\n return DEFAULT_BIT_RELEASE_TYPE;\n };\n const getPreReleaseId = (): string | undefined => {\n if (prereleaseId) {\n return prereleaseId;\n }\n if (preRelease && typeof preRelease === 'string') {\n return preRelease;\n }\n return undefined;\n };\n\n const disableTagAndSnapPipelines = disableTagPipeline;\n build = (await this.globalConfig.getBool(CFG_FORCE_LOCAL_BUILD)) || Boolean(build);\n if (persist) {\n if (persist === true) build = true;\n else if (persist === 'skip-build') build = false;\n else throw new BitError(`unknown value for --persist, use either --persist or --persist=skip-build`);\n }\n if (!build && !soft) {\n this.logger.consoleWarning(\n `tagging components on \"main\" lane when using remote build is not recommended. To avoid SemVer versions of your component with failing builds, please refer to:\n- Snap changes in a different lane and merge to \"main\" on your remote (learn more on lanes - https://bit.dev/reference/lanes/getting-started-with-lanes)\n- Use \\`bit tag --build\\` to build your components locally.\n- Use \\`snap\\` or \\`build\\` first to validate your build passing, and then version and export safely.\n\nTo undo local tag use the \"bit reset\" command.`\n );\n }\n\n const params = {\n ids: patterns,\n snapped,\n unmerged,\n editor,\n message,\n releaseType: getReleaseType(),\n preReleaseId: getPreReleaseId(),\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipTasks,\n skipAutoTag,\n build,\n soft,\n persist,\n unmodified,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n incrementBy,\n version: ver,\n failFast,\n includeLocalOnly,\n };\n\n const results = await this.snapping.tag(params);\n if (!results) return chalk.yellow(persist ? 'no soft-tag found' : NOTHING_TO_TAG_MSG);\n const { taggedComponents, autoTaggedResults, warnings, newComponents, removedComponents }: TagResults = results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the soft-tagged changes as a fully tagged version\")\n(use \"bit reset --soft\" to remove the soft-tags)`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoTaggedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label, explanation, components: ConsumerComponent[]) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged with first version for components when persisted'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that are set to get a version bump when persisted'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n '\\nkeep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n publishOutput() +\n warningsOutput +\n chalk.green(\n `\\n${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`\n ) +\n tagExplanation +\n softTagClarification\n );\n }\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n return `\\n${chalk.underline(label)}\\n${ids.map((id) => id.toStringWithoutVersion()).join('\\n')}\\n`;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,S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AAEM,WAAW,EAAErC,iBAAiB,CAAC,GACpEuC,iBAAiB,CAAC,oBAAoB,EAAExC,iBAAiB,CAAC,GAC1DyB,aAAa,CAAC,CAAC,GACflB,cAAc,GACdb,gBAAK,CAACkC,KAAK,CACT,KAAKhC,gBAAgB,CAACnB,MAAM,GAAG6B,eAAe,iBAAiBd,OAAO,CAACmB,SAAS,GAAG,OAAO,GAAG,EAAE,QACjG,CAAC,GACDD,cAAc,GACd6B,oBAAoB;EAExB;AACF;AAAC/G,OAAA,CAAAG,MAAA,GAAAA,MAAA;AAEM,SAAS6G,iBAAiBA,CAACP,KAAa,EAAE7C,GAAqB,EAAE;EACtE,IAAI,CAACA,GAAG,EAAEX,MAAM,EAAE,OAAO,EAAE;EAC3B,OAAO,KAAKiB,gBAAK,CAAC0C,SAAS,CAACH,KAAK,CAAC,KAAK7C,GAAG,CAAC8B,GAAG,CAAEd,EAAE,IAAKA,EAAE,CAACW,sBAAsB,CAAC,CAAC,CAAC,CAAC5E,IAAI,CAAC,IAAI,CAAC,IAAI;AACpG","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","_componentIssues","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","NOTHING_TO_TAG_MSG","exports","AUTO_TAGGED_MSG","RELEASE_TYPES","TagCmd","constructor","snapping","logger","globalConfig","name","description","COMPONENT_PATTERN_HELP","join","keys","IssuesClasses","cmd","report","patterns","message","ver","editor","snapped","unmerged","patch","minor","major","preRelease","increment","prereleaseId","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","build","soft","persist","disableTagPipeline","forceDeploy","ignoreBuildErrors","rebuildDepsGraph","failFast","incrementBy","consoleWarning","BitError","releaseFlags","filter","x","length","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","disableTagAndSnapPipelines","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","params","ids","releaseType","preReleaseId","version","results","tag","chalk","yellow","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","compInBold","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","softTagPrefix","outputIfExists","label","explanation","components","underline","newDesc","changedDesc","softTagClarification","outputIdsIfExists"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport {\n DEFAULT_BIT_RELEASE_TYPE,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TagResults, SnappingMain } from './snapping.main.runtime';\nimport { BasicTagParams } from './tag-model-component';\n\nexport const NOTHING_TO_TAG_MSG = 'nothing to tag';\nexport const AUTO_TAGGED_MSG = 'auto-tagged dependents';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'development';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'a log message describing latest changes'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\n ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'tag only components whose head is a snap (not a tag)'],\n ['', 'unmerged', 'complete a merge process by tagging the unmerged components'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n [\n '',\n 'persist [skip-build]',\n 'persist the changes generated by --soft tag. by default, run the build pipeline, unless \"skip-build\" is provided',\n ],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'force-deploy', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'proceed to tag pipeline even when build pipeline fails'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n 'I',\n 'ignore-newest-version',\n 'allow tagging even when the component has newer versions e.g. for hotfixes (default = false)',\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the tag'],\n ] as CommandOptions;\n remoteOp = true; // In case a compiler / tester is not installed\n examples = [{ cmd: 'tag --ver 1.0.0', description: 'tag all components to version 1.0.0' }];\n\n constructor(private snapping: SnappingMain, private logger: Logger, private globalConfig: GlobalConfigMain) {}\n\n // eslint-disable-next-line complexity\n async report(\n [patterns = []]: [string[]],\n {\n message = '',\n ver,\n editor = '',\n snapped = false,\n unmerged = false,\n patch,\n minor,\n major,\n preRelease,\n increment,\n prereleaseId,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag = false,\n unmodified = false,\n build,\n soft = false,\n persist = false,\n disableTagPipeline = false,\n forceDeploy = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n failFast = false,\n incrementBy = 1,\n }: {\n snapped?: boolean;\n unmerged?: boolean;\n ver?: string;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n forceDeploy?: boolean;\n } & Partial<BasicTagParams>\n ): Promise<string> {\n if (!message && !persist && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your tag`\n );\n }\n if (prereleaseId && (!increment || increment === 'major' || increment === 'minor' || increment === 'patch')) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment flag, while --increment must be one of the following: [prepatch, prerelease, preminor, premajor]`\n );\n }\n if (forceDeploy) {\n this.logger.consoleWarning(`--force-deploy is deprecated, use --ignore-build-errors instead`);\n ignoreBuildErrors = true;\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\n semver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return increment;\n }\n if (major) return 'major';\n if (minor) return 'minor';\n if (patch) return 'patch';\n if (preRelease) return 'prerelease';\n return DEFAULT_BIT_RELEASE_TYPE;\n };\n const getPreReleaseId = (): string | undefined => {\n if (prereleaseId) {\n return prereleaseId;\n }\n if (preRelease && typeof preRelease === 'string') {\n return preRelease;\n }\n return undefined;\n };\n\n const disableTagAndSnapPipelines = disableTagPipeline;\n build = (await this.globalConfig.getBool(CFG_FORCE_LOCAL_BUILD)) || Boolean(build);\n if (persist) {\n if (persist === true) build = true;\n else if (persist === 'skip-build') build = false;\n else throw new BitError(`unknown value for --persist, use either --persist or --persist=skip-build`);\n }\n if (!build && !soft) {\n this.logger.consoleWarning(\n `tagging components on \"main\" lane when using remote build is not recommended. To avoid SemVer versions of your component with failing builds, please refer to:\n- Snap changes in a different lane and merge to \"main\" on your remote (learn more on lanes - https://bit.dev/reference/lanes/getting-started-with-lanes)\n- Use \\`bit tag --build\\` to build your components locally.\n- Use \\`snap\\` or \\`build\\` first to validate your build passing, and then version and export safely.\n\nTo undo local tag use the \"bit reset\" command.`\n );\n }\n\n const params = {\n ids: patterns,\n snapped,\n unmerged,\n editor,\n message,\n releaseType: getReleaseType(),\n preReleaseId: getPreReleaseId(),\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipTasks,\n skipAutoTag,\n build,\n soft,\n persist,\n unmodified,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n incrementBy,\n version: ver,\n failFast,\n };\n\n const results = await this.snapping.tag(params);\n if (!results) return chalk.yellow(persist ? 'no soft-tag found' : NOTHING_TO_TAG_MSG);\n const { taggedComponents, autoTaggedResults, warnings, newComponents, removedComponents }: TagResults = results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the soft-tagged changes as a fully tagged version\")\n(use \"bit reset --soft\" to remove the soft-tags)`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoTaggedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label, explanation, components: ConsumerComponent[]) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged with first version for components when persisted'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that are set to get a version bump when persisted'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n '\\nkeep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n publishOutput() +\n warningsOutput +\n chalk.green(\n `\\n${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`\n ) +\n tagExplanation +\n softTagClarification\n );\n }\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n return `\\n${chalk.underline(label)}\\n${ids.map((id) => id.toStringWithoutVersion()).join('\\n')}\\n`;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,O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17
  ignoreBuildErrors?: boolean;
18
18
  rebuildDepsGraph?: boolean;
19
- includeLocalOnly?: boolean;
20
19
  };
21
20
  export type BasicTagParams = BasicTagSnapParams & {
22
21
  ignoreNewestVersion?: boolean;
@@ -245,7 +245,9 @@ async function tagModelComponent({
245
245
  // ids without versions are new. it's impossible that tagged (and not-modified) components has
246
246
  // them as dependencies.
247
247
  const idsToTriggerAutoTag = idsToTag.filter(id => id.hasVersion());
248
- const autoTagData = skipAutoTag || !consumer ? [] : await (0, _autoTag().getAutoTagInfo)(consumer, _componentId().ComponentIdList.fromArray(idsToTriggerAutoTag));
248
+ const autoTagDataWithLocalOnly = skipAutoTag || !consumer ? [] : await (0, _autoTag().getAutoTagInfo)(consumer, _componentId().ComponentIdList.fromArray(idsToTriggerAutoTag));
249
+ const localOnly = workspace?.listLocalOnly();
250
+ const autoTagData = localOnly ? autoTagDataWithLocalOnly.filter(autoTagItem => !localOnly.hasWithoutVersion(autoTagItem.component.id)) : autoTagDataWithLocalOnly;
249
251
  const autoTagComponents = autoTagData.map(autoTagItem => autoTagItem.component);
250
252
  const autoTagComponentsFiltered = autoTagComponents.filter(c => !idsToTag.has(c.id));
251
253
  const autoTagIds = _componentId().ComponentIdList.fromArray(autoTagComponentsFiltered.map(autoTag => autoTag.id));
@@ -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","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","workspace","snapping","builder","consumerComponents","populateArtifactsFrom","message","editor","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","build","isSnap","disableTagAndSnapPipelines","ignoreBuildErrors","rebuildDepsGraph","packageManagerConfigRootDir","copyLogFromPreviousSnap","exitOnFirstFailedTask","updateDependentsOnLane","consumer","legacyScope","consumerComponentsIdsMap","consumerComponent","componentIdString","toString","Object","values","idsToTag","ComponentIdList","fromArray","idsToTriggerAutoTag","autoTagData","getAutoTagInfo","autoTagComponents","autoTagItem","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","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","bitMap","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","config","addComponentConfig","removeConfig","hash","getRef","stagedSnaps","addSnap","getConfigPerId","clearNextVersion"],"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 { 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 { BuilderMain, 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 { 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 includeLocalOnly?: 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 workspace,\n scope,\n snapping,\n builder,\n consumerComponents,\n ids,\n tagDataPerComp,\n populateArtifactsFrom,\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 dependencyResolver,\n copyLogFromPreviousSnap = false,\n exitOnFirstFailedTask = false,\n updateDependentsOnLane = false, // on lane, adds it into updateDependents prop\n}: {\n workspace?: Workspace;\n scope: ScopeMain;\n snapping: SnappingMain;\n builder: BuilderMain;\n consumerComponents: ConsumerComponent[];\n ids: ComponentIdList;\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n dependencyResolver: DependencyResolverMain;\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 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 autoTagData =\n skipAutoTag || !consumer ? [] : await getAutoTagInfo(consumer, ComponentIdList.fromArray(idsToTriggerAutoTag));\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 };\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 }\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 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 config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config);\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 // 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"],"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,IA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AACmK,WAAW,CAACnD,KAAK,CAAC,CAAC;EAErD,OAAOhE,YAAY;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_uuid","_bitError","_componentId","_constants","_componentSchema","_workspaceModules","_exceptions","_remove","_logger","_pkgModules","_harmonyModules","_toolboxCrypto","_autoTag","_messagePerComponent","_models","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","workspace","snapping","builder","consumerComponents","populateArtifactsFrom","message","editor","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","build","isSnap","disableTagAndSnapPipelines","ignoreBuildErrors","rebuildDepsGraph","packageManagerConfigRootDir","copyLogFromPreviousSnap","exitOnFirstFailedTask","updateDependentsOnLane","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","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","bitMap","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","config","addComponentConfig","removeConfig","hash","getRef","stagedSnaps","addSnap","getConfigPerId","clearNextVersion"],"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 { 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 { BuilderMain, 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 { 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 workspace,\n scope,\n snapping,\n builder,\n consumerComponents,\n ids,\n tagDataPerComp,\n populateArtifactsFrom,\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 dependencyResolver,\n copyLogFromPreviousSnap = false,\n exitOnFirstFailedTask = false,\n updateDependentsOnLane = false, // on lane, adds it into updateDependents prop\n}: {\n workspace?: Workspace;\n scope: ScopeMain;\n snapping: SnappingMain;\n builder: BuilderMain;\n consumerComponents: ConsumerComponent[];\n ids: ComponentIdList;\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n dependencyResolver: DependencyResolverMain;\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 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 };\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 }\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 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 config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config);\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 // 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"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA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