@teambit/snapping 1.0.1174 → 1.0.1176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tag-cmd.js CHANGED
@@ -294,6 +294,7 @@ function tagResultReport(results) {
294
294
  return (0, _cli().formatSection)('exported components', '', items);
295
295
  })();
296
296
  const warningsSection = warnings && warnings.length ? warnings.map(w => `${_cli().warnSymbol} ${_chalk().default.yellow(w)}`).join('\n') : '';
297
+ const workspaceRootHint = results.autoAddedWorkspaceRoot ? (0, _cli().formatHint)(`(${compInBold(results.autoAddedWorkspaceRoot)} is the workspace-root component. it was new or modified, so it was tagged along: the other components record the root version they were tagged with)`) : '';
297
298
  const summaryMsg = `${totalCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged${exportedIds ? ' and exported' : ''}`;
298
299
  const summary = (0, _cli().formatSuccessSummary)(summaryMsg);
299
300
  const tagExplanation = results.isSoftTag ? (0, _cli().formatHint)('(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)') : exportedIds ? '' : (0, _cli().formatHint)('(use "bit export" to push these components to a remote)\n(use "bit reset" to unstage versions)');
@@ -319,7 +320,7 @@ function tagResultReport(results) {
319
320
  return `${title}\n${scopes}\n${hint}`;
320
321
  })();
321
322
  const footerParts = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\n');
322
- const data = (0, _cli().joinSections)([newSection, changedSection, autoTagSection, removedSection, publishSection, exportedSection, warningsSection, footerParts]);
323
+ const data = (0, _cli().joinSections)([newSection, changedSection, workspaceRootHint, autoTagSection, removedSection, publishSection, exportedSection, warningsSection, footerParts]);
323
324
  if (!hasAutoTagged) {
324
325
  return data;
325
326
  }
@@ -330,7 +331,7 @@ function tagResultReport(results) {
330
331
  changedSection: changedDetailed
331
332
  } = buildSections(formatCompDetailed);
332
333
  const detailedFooter = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\n');
333
- const details = (0, _cli().joinSections)([newDetailed, changedDetailed, removedSection, publishSection, exportedSection, warningsSection, detailedFooter]);
334
+ const details = (0, _cli().joinSections)([newDetailed, changedDetailed, workspaceRootHint, removedSection, publishSection, exportedSection, warningsSection, detailedFooter]);
334
335
  return {
335
336
  data,
336
337
  code: 0,
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cli","_legacy","_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","PRE_RELEASE_TYPES","isPreReleaseType","releaseType","Boolean","includes","tagCmdOptions","join","keys","IssuesClasses","TagCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","cmd","report","patterns","options","message","ver","editor","versionsFile","snapped","unmerged","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","soft","persist","disableTagPipeline","ignoreBuildErrors","rebuildDepsGraph","noLockDeps","failFast","incrementBy","skipPublishedVersions","detachHead","loose","consoleWarning","autoTagReleaseType","preReleaseId","validateOptions","disableTagAndSnapPipelines","build","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","BitError","params","ids","version","results","tag","chalk","yellow","tagResultReport","patch","minor","major","preRelease","increment","autoTagIncrement","prereleaseId","releaseFlags","filter","x","length","getReleaseType","DEFAULT_BIT_RELEASE_TYPE","getAutoTagReleaseType","undefined","getPreReleaseId","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","exportedIds","totalComponentsCount","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","totalCount","formatCompMinimal","formatItem","compInBold","formatCompDetailed","output","autoTag","result","triggeredBy","autoTagComp","map","a","toString","softTagPrefix","isSoftTag","newDesc","changedDesc","buildSections","formatComp","newSection","formatSection","changedSection","removedSection","outputIdsIfExists","publishSection","publishedPackages","items","pkg","exportedSection","warnSymbol","warningsSection","w","summaryMsg","summary","formatSuccessSummary","tagExplanation","formatHint","softTagClarification","bold","hasAutoTagged","autoTagSection","scopeCounts","countBy","scope","sorted","entries","sort","b","MAX_SHOWN","shown","slice","n","remaining","scopeLine","title","formatTitle","scopes","hint","formatDetailsHint","footerParts","joinSections","newDetailed","changedDetailed","detailedFooter","details","code","tagResultOutput","hasVersion","toStringWithoutVersion","label"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { countBy } from 'lodash';\nimport type { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Command, CommandOptions, Report } from '@teambit/cli';\nimport {\n formatItem,\n formatSection,\n formatTitle,\n formatHint,\n formatDetailsHint,\n formatSuccessSummary,\n warnSymbol,\n joinSections,\n} from '@teambit/cli';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { DEFAULT_BIT_RELEASE_TYPE, COMPONENT_PATTERN_HELP, CFG_FORCE_LOCAL_BUILD } from '@teambit/legacy.constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { TagResults, SnappingMain } from './snapping.main.runtime';\nimport type { BasicTagParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\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'];\nconst PRE_RELEASE_TYPES = ['prepatch', 'prerelease', 'preminor', 'premajor'];\n\nfunction isPreReleaseType(releaseType?: ReleaseType): boolean {\n return Boolean(releaseType && PRE_RELEASE_TYPES.includes(releaseType));\n}\n\nexport const tagCmdOptions = [\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 ['', 'versions-file <path>', 'path to a file containing component versions. format: \"component-id: version\"'],\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 [\n '',\n 'auto-tag-increment <level>',\n `the increment level to use for auto-tagged dependents. options are: [${RELEASE_TYPES.join(', ')}].\nby default, dependents are bumped by a patch, unless --increment is one of [${PRE_RELEASE_TYPES.join(', ')}], which they follow.\nnote that dependents are auto-tagged transitively, so the entire dependents graph is bumped by this level`,\n ],\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 ['', '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 ['', 'no-lock-deps', 'do not save the dependencies graph in the tag'],\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 '',\n 'skip-published-versions',\n 'skip versions that are already in the registry. useful when a previous run published the packages but failed before exporting',\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 ['I', 'ignore-newest-version', 'allow tagging even when the component has newer versions e.g. for hotfixes.'],\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 ['', 'loose', 'allow tag --build to succeed even if tasks like tests or lint fail'],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, tag it without changing the head',\n ],\n] as CommandOptions;\n\nexport type TagParams = {\n snapped?: boolean;\n unmerged?: boolean;\n ver?: string;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n autoTagIncrement?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n loose?: boolean;\n versionsFile?: string;\n} & Partial<BasicTagParams>;\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'version-control';\n description = 'create immutable component snapshots with semantic version tags';\n extendedDescription = `creates tagged versions using semantic versioning (semver) for component releases. tags are immutable and exportable.\nby default tags all new and modified components. supports version specification per pattern using \"@\" (e.g. foo@1.0.0, bar@minor).\nuse for official releases. for development versions, use 'bit snap' instead.`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = tagCmdOptions;\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(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n // eslint-disable-next-line complexity\n async report([patterns = []]: [string[]], options: TagParams): Promise<string | Report> {\n const {\n message = '',\n ver,\n editor = '',\n versionsFile,\n snapped = false,\n unmerged = false,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag = false,\n unmodified = false,\n soft = false,\n persist = false,\n disableTagPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n noLockDeps = false,\n failFast = false,\n incrementBy = 1,\n skipPublishedVersions = false,\n detachHead,\n loose = false,\n } = options;\n\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 const { releaseType, autoTagReleaseType, preReleaseId } = validateOptions(options);\n\n const disableTagAndSnapPipelines = disableTagPipeline;\n let build = options.build;\n build = this.configStore.getConfigBoolean(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 versionsFile,\n message,\n releaseType,\n autoTagReleaseType,\n preReleaseId,\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 noLockDeps,\n incrementBy,\n skipPublishedVersions,\n version: ver,\n failFast,\n detachHead,\n loose,\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 return tagResultReport(results);\n }\n}\n\nexport function validateOptions(options: TagParams) {\n const { patch, minor, major, preRelease, increment, autoTagIncrement, prereleaseId, skipAutoTag } = options;\n // the prerelease-id is relevant for the dependents as well, so --auto-tag-increment alone is\n // enough to justify it, even when the modified components get a non-prerelease bump.\n if (prereleaseId && !isPreReleaseType(increment) && !isPreReleaseType(autoTagIncrement)) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment or --auto-tag-increment flag, while the increment must be one of the following: [${PRE_RELEASE_TYPES.join(', ')}]`\n );\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 if (autoTagIncrement && skipAutoTag) {\n throw new BitError('you can use either --auto-tag-increment or --skip-auto-tag, but not both');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\nsemver 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 getAutoTagReleaseType = (): ReleaseType | undefined => {\n if (!autoTagIncrement) return undefined;\n if (!RELEASE_TYPES.includes(autoTagIncrement)) {\n throw new BitError(`invalid auto-tag-increment level \"${autoTagIncrement}\".\nsemver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return autoTagIncrement;\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 return {\n releaseType: getReleaseType(),\n autoTagReleaseType: getAutoTagReleaseType(),\n preReleaseId: getPreReleaseId(),\n };\n}\n\nexport function tagResultReport(results: TagResults): string | Report {\n const {\n taggedComponents,\n autoTaggedResults,\n warnings,\n newComponents,\n removedComponents,\n exportedIds,\n totalComponentsCount,\n }: 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 const totalCount = totalComponentsCount ?? taggedComponents.length + autoTaggedCount;\n\n const formatCompMinimal = (component: ConsumerComponent): string => {\n return formatItem(compInBold(component.id));\n };\n\n const formatCompDetailed = (component: ConsumerComponent): string => {\n let output = formatItem(compInBold(component.id));\n const autoTag = (autoTaggedResults ?? []).filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n output += `\\n ${AUTO_TAGGED_MSG}:\\n ${autoTagComp.join('\\n ')}`;\n }\n return output;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\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\n const buildSections = (formatComp: (c: ConsumerComponent) => string) => {\n const newSection = formatSection(softTagPrefix + 'new components', newDesc, addedComponents.map(formatComp));\n const changedSection = formatSection(\n softTagPrefix + 'changed components',\n changedDesc,\n changedComponents.map(formatComp)\n );\n return { newSection, changedSection };\n };\n\n const removedSection = outputIdsIfExists('removed components', removedComponents);\n\n const publishSection = (() => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const items = publishedPackages.map((pkg) => formatItem(pkg));\n return formatSection('published components', '', items);\n })();\n\n const exportedSection = (() => {\n if (!exportedIds) return '';\n if (!exportedIds.length) return `${warnSymbol} ${chalk.yellow('no component has been exported')}`;\n const items = exportedIds.map((id) => formatItem(compInBold(id)));\n return formatSection('exported components', '', items);\n })();\n\n const warningsSection =\n warnings && warnings.length ? warnings.map((w) => `${warnSymbol} ${chalk.yellow(w)}`).join('\\n') : '';\n\n const summaryMsg = `${totalCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged${exportedIds ? ' and exported' : ''}`;\n const summary = formatSuccessSummary(summaryMsg);\n\n const tagExplanation = results.isSoftTag\n ? formatHint(\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 : exportedIds\n ? ''\n : formatHint('(use \"bit export\" to push these components to a remote)\\n(use \"bit reset\" to unstage versions)');\n\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n 'keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n\n const hasAutoTagged = autoTaggedCount > 0;\n\n // Build minimal output (no auto-tagged listing, just counts grouped by scope)\n const { newSection, changedSection } = buildSections(hasAutoTagged ? formatCompMinimal : formatCompDetailed);\n\n const autoTagSection = (() => {\n if (!hasAutoTagged) return '';\n const scopeCounts = countBy(autoTaggedResults, (r) => r.component.id.scope);\n const sorted = Object.entries(scopeCounts).sort(([, a], [, b]) => b - a);\n const MAX_SHOWN = 4;\n const shown = sorted.slice(0, MAX_SHOWN).map(([scope, n]) => `${scope} (${n})`);\n const remaining = sorted.length - MAX_SHOWN;\n const scopeLine = remaining > 0 ? [...shown, `+ ${remaining} more scopes`].join(' · ') : shown.join(' · ');\n const title = formatTitle(`auto-tagged dependents (${autoTaggedCount})`);\n const scopes = ` ${scopeLine}`;\n const hint = formatDetailsHint('full list of auto-tagged dependents');\n return `${title}\\n${scopes}\\n${hint}`;\n })();\n\n const footerParts = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\\n');\n const data = joinSections([\n newSection,\n changedSection,\n autoTagSection,\n removedSection,\n publishSection,\n exportedSection,\n warningsSection,\n footerParts,\n ]);\n\n if (!hasAutoTagged) {\n return data;\n }\n\n // Build detailed output (with full auto-tagged listing)\n const { newSection: newDetailed, changedSection: changedDetailed } = buildSections(formatCompDetailed);\n const detailedFooter = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\\n');\n const details = joinSections([\n newDetailed,\n changedDetailed,\n removedSection,\n publishSection,\n exportedSection,\n warningsSection,\n detailedFooter,\n ]);\n\n return { data, code: 0, details };\n}\n\n/** @deprecated use tagResultReport instead */\nexport function tagResultOutput(results: TagResults): string {\n const result = tagResultReport(results);\n return typeof result === 'string' ? result : result.details || result.data;\n}\n\nexport function compInBold(id: ComponentID): string {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n const items = ids.map((id) => formatItem(id.toStringWithoutVersion(), warnSymbol));\n return formatSection(label, '', items);\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;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAA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AAe,EACfE,eAAe,EACfiC,cAAc,CACf,CAAC;EAEF,OAAO;IAAE1L,IAAI;IAAE4L,IAAI,EAAE,CAAC;IAAED;EAAQ,CAAC;AACnC;;AAEA;AACO,SAASE,eAAeA,CAACpG,OAAmB,EAAU;EAC3D,MAAMyC,MAAM,GAAGrC,eAAe,CAACJ,OAAO,CAAC;EACvC,OAAO,OAAOyC,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAACyD,OAAO,IAAIzD,MAAM,CAAClI,IAAI;AAC5E;AAEO,SAAS8H,UAAUA,CAACN,EAAe,EAAU;EAClD,MAAMhC,OAAO,GAAGgC,EAAE,CAACsE,UAAU,CAAC,CAAC,GAAG,IAAItE,EAAE,CAAChC,OAAO,EAAE,GAAG,EAAE;EACvD,OAAO,GAAGG,gBAAK,CAACsE,IAAI,CAACzC,EAAE,CAACuE,sBAAsB,CAAC,CAAC,CAAC,GAAGvG,OAAO,EAAE;AAC/D;AAEO,SAAS0D,iBAAiBA,CAAC8C,KAAa,EAAEzG,GAAqB,EAAE;EACtE,IAAI,CAACA,GAAG,EAAEiB,MAAM,EAAE,OAAO,EAAE;EAC3B,MAAM6C,KAAK,GAAG9D,GAAG,CAAC8C,GAAG,CAAEb,EAAE,IAAK,IAAAK,iBAAU,EAACL,EAAE,CAACuE,sBAAsB,CAAC,CAAC,EAAEvC,iBAAU,CAAC,CAAC;EAClF,OAAO,IAAAT,oBAAa,EAACiD,KAAK,EAAE,EAAE,EAAE3C,KAAK,CAAC;AACxC","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cli","_legacy","_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","PRE_RELEASE_TYPES","isPreReleaseType","releaseType","Boolean","includes","tagCmdOptions","join","keys","IssuesClasses","TagCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","cmd","report","patterns","options","message","ver","editor","versionsFile","snapped","unmerged","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","soft","persist","disableTagPipeline","ignoreBuildErrors","rebuildDepsGraph","noLockDeps","failFast","incrementBy","skipPublishedVersions","detachHead","loose","consoleWarning","autoTagReleaseType","preReleaseId","validateOptions","disableTagAndSnapPipelines","build","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","BitError","params","ids","version","results","tag","chalk","yellow","tagResultReport","patch","minor","major","preRelease","increment","autoTagIncrement","prereleaseId","releaseFlags","filter","x","length","getReleaseType","DEFAULT_BIT_RELEASE_TYPE","getAutoTagReleaseType","undefined","getPreReleaseId","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","exportedIds","totalComponentsCount","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","totalCount","formatCompMinimal","formatItem","compInBold","formatCompDetailed","output","autoTag","result","triggeredBy","autoTagComp","map","a","toString","softTagPrefix","isSoftTag","newDesc","changedDesc","buildSections","formatComp","newSection","formatSection","changedSection","removedSection","outputIdsIfExists","publishSection","publishedPackages","items","pkg","exportedSection","warnSymbol","warningsSection","w","workspaceRootHint","autoAddedWorkspaceRoot","formatHint","summaryMsg","summary","formatSuccessSummary","tagExplanation","softTagClarification","bold","hasAutoTagged","autoTagSection","scopeCounts","countBy","scope","sorted","entries","sort","b","MAX_SHOWN","shown","slice","n","remaining","scopeLine","title","formatTitle","scopes","hint","formatDetailsHint","footerParts","joinSections","newDetailed","changedDetailed","detailedFooter","details","code","tagResultOutput","hasVersion","toStringWithoutVersion","label"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { countBy } from 'lodash';\nimport type { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Command, CommandOptions, Report } from '@teambit/cli';\nimport {\n formatItem,\n formatSection,\n formatTitle,\n formatHint,\n formatDetailsHint,\n formatSuccessSummary,\n warnSymbol,\n joinSections,\n} from '@teambit/cli';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { DEFAULT_BIT_RELEASE_TYPE, COMPONENT_PATTERN_HELP, CFG_FORCE_LOCAL_BUILD } from '@teambit/legacy.constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { TagResults, SnappingMain } from './snapping.main.runtime';\nimport type { BasicTagParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\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'];\nconst PRE_RELEASE_TYPES = ['prepatch', 'prerelease', 'preminor', 'premajor'];\n\nfunction isPreReleaseType(releaseType?: ReleaseType): boolean {\n return Boolean(releaseType && PRE_RELEASE_TYPES.includes(releaseType));\n}\n\nexport const tagCmdOptions = [\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 ['', 'versions-file <path>', 'path to a file containing component versions. format: \"component-id: version\"'],\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 [\n '',\n 'auto-tag-increment <level>',\n `the increment level to use for auto-tagged dependents. options are: [${RELEASE_TYPES.join(', ')}].\nby default, dependents are bumped by a patch, unless --increment is one of [${PRE_RELEASE_TYPES.join(', ')}], which they follow.\nnote that dependents are auto-tagged transitively, so the entire dependents graph is bumped by this level`,\n ],\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 ['', '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 ['', 'no-lock-deps', 'do not save the dependencies graph in the tag'],\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 '',\n 'skip-published-versions',\n 'skip versions that are already in the registry. useful when a previous run published the packages but failed before exporting',\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 ['I', 'ignore-newest-version', 'allow tagging even when the component has newer versions e.g. for hotfixes.'],\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 ['', 'loose', 'allow tag --build to succeed even if tasks like tests or lint fail'],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, tag it without changing the head',\n ],\n] as CommandOptions;\n\nexport type TagParams = {\n snapped?: boolean;\n unmerged?: boolean;\n ver?: string;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n autoTagIncrement?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n loose?: boolean;\n versionsFile?: string;\n} & Partial<BasicTagParams>;\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'version-control';\n description = 'create immutable component snapshots with semantic version tags';\n extendedDescription = `creates tagged versions using semantic versioning (semver) for component releases. tags are immutable and exportable.\nby default tags all new and modified components. supports version specification per pattern using \"@\" (e.g. foo@1.0.0, bar@minor).\nuse for official releases. for development versions, use 'bit snap' instead.`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = tagCmdOptions;\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(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n // eslint-disable-next-line complexity\n async report([patterns = []]: [string[]], options: TagParams): Promise<string | Report> {\n const {\n message = '',\n ver,\n editor = '',\n versionsFile,\n snapped = false,\n unmerged = false,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag = false,\n unmodified = false,\n soft = false,\n persist = false,\n disableTagPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n noLockDeps = false,\n failFast = false,\n incrementBy = 1,\n skipPublishedVersions = false,\n detachHead,\n loose = false,\n } = options;\n\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 const { releaseType, autoTagReleaseType, preReleaseId } = validateOptions(options);\n\n const disableTagAndSnapPipelines = disableTagPipeline;\n let build = options.build;\n build = this.configStore.getConfigBoolean(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 versionsFile,\n message,\n releaseType,\n autoTagReleaseType,\n preReleaseId,\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 noLockDeps,\n incrementBy,\n skipPublishedVersions,\n version: ver,\n failFast,\n detachHead,\n loose,\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 return tagResultReport(results);\n }\n}\n\nexport function validateOptions(options: TagParams) {\n const { patch, minor, major, preRelease, increment, autoTagIncrement, prereleaseId, skipAutoTag } = options;\n // the prerelease-id is relevant for the dependents as well, so --auto-tag-increment alone is\n // enough to justify it, even when the modified components get a non-prerelease bump.\n if (prereleaseId && !isPreReleaseType(increment) && !isPreReleaseType(autoTagIncrement)) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment or --auto-tag-increment flag, while the increment must be one of the following: [${PRE_RELEASE_TYPES.join(', ')}]`\n );\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 if (autoTagIncrement && skipAutoTag) {\n throw new BitError('you can use either --auto-tag-increment or --skip-auto-tag, but not both');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\nsemver 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 getAutoTagReleaseType = (): ReleaseType | undefined => {\n if (!autoTagIncrement) return undefined;\n if (!RELEASE_TYPES.includes(autoTagIncrement)) {\n throw new BitError(`invalid auto-tag-increment level \"${autoTagIncrement}\".\nsemver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return autoTagIncrement;\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 return {\n releaseType: getReleaseType(),\n autoTagReleaseType: getAutoTagReleaseType(),\n preReleaseId: getPreReleaseId(),\n };\n}\n\nexport function tagResultReport(results: TagResults): string | Report {\n const {\n taggedComponents,\n autoTaggedResults,\n warnings,\n newComponents,\n removedComponents,\n exportedIds,\n totalComponentsCount,\n }: 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 const totalCount = totalComponentsCount ?? taggedComponents.length + autoTaggedCount;\n\n const formatCompMinimal = (component: ConsumerComponent): string => {\n return formatItem(compInBold(component.id));\n };\n\n const formatCompDetailed = (component: ConsumerComponent): string => {\n let output = formatItem(compInBold(component.id));\n const autoTag = (autoTaggedResults ?? []).filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n output += `\\n ${AUTO_TAGGED_MSG}:\\n ${autoTagComp.join('\\n ')}`;\n }\n return output;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\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\n const buildSections = (formatComp: (c: ConsumerComponent) => string) => {\n const newSection = formatSection(softTagPrefix + 'new components', newDesc, addedComponents.map(formatComp));\n const changedSection = formatSection(\n softTagPrefix + 'changed components',\n changedDesc,\n changedComponents.map(formatComp)\n );\n return { newSection, changedSection };\n };\n\n const removedSection = outputIdsIfExists('removed components', removedComponents);\n\n const publishSection = (() => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const items = publishedPackages.map((pkg) => formatItem(pkg));\n return formatSection('published components', '', items);\n })();\n\n const exportedSection = (() => {\n if (!exportedIds) return '';\n if (!exportedIds.length) return `${warnSymbol} ${chalk.yellow('no component has been exported')}`;\n const items = exportedIds.map((id) => formatItem(compInBold(id)));\n return formatSection('exported components', '', items);\n })();\n\n const warningsSection =\n warnings && warnings.length ? warnings.map((w) => `${warnSymbol} ${chalk.yellow(w)}`).join('\\n') : '';\n\n const workspaceRootHint = results.autoAddedWorkspaceRoot\n ? formatHint(\n `(${compInBold(results.autoAddedWorkspaceRoot)} is the workspace-root component. it was new or modified, so it was tagged along: the other components record the root version they were tagged with)`\n )\n : '';\n\n const summaryMsg = `${totalCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged${exportedIds ? ' and exported' : ''}`;\n const summary = formatSuccessSummary(summaryMsg);\n\n const tagExplanation = results.isSoftTag\n ? formatHint(\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 : exportedIds\n ? ''\n : formatHint('(use \"bit export\" to push these components to a remote)\\n(use \"bit reset\" to unstage versions)');\n\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n 'keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n\n const hasAutoTagged = autoTaggedCount > 0;\n\n // Build minimal output (no auto-tagged listing, just counts grouped by scope)\n const { newSection, changedSection } = buildSections(hasAutoTagged ? formatCompMinimal : formatCompDetailed);\n\n const autoTagSection = (() => {\n if (!hasAutoTagged) return '';\n const scopeCounts = countBy(autoTaggedResults, (r) => r.component.id.scope);\n const sorted = Object.entries(scopeCounts).sort(([, a], [, b]) => b - a);\n const MAX_SHOWN = 4;\n const shown = sorted.slice(0, MAX_SHOWN).map(([scope, n]) => `${scope} (${n})`);\n const remaining = sorted.length - MAX_SHOWN;\n const scopeLine = remaining > 0 ? [...shown, `+ ${remaining} more scopes`].join(' · ') : shown.join(' · ');\n const title = formatTitle(`auto-tagged dependents (${autoTaggedCount})`);\n const scopes = ` ${scopeLine}`;\n const hint = formatDetailsHint('full list of auto-tagged dependents');\n return `${title}\\n${scopes}\\n${hint}`;\n })();\n\n const footerParts = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\\n');\n const data = joinSections([\n newSection,\n changedSection,\n workspaceRootHint,\n autoTagSection,\n removedSection,\n publishSection,\n exportedSection,\n warningsSection,\n footerParts,\n ]);\n\n if (!hasAutoTagged) {\n return data;\n }\n\n // Build detailed output (with full auto-tagged listing)\n const { newSection: newDetailed, changedSection: changedDetailed } = buildSections(formatCompDetailed);\n const detailedFooter = [summary, tagExplanation, softTagClarification].filter(Boolean).join('\\n');\n const details = joinSections([\n newDetailed,\n changedDetailed,\n workspaceRootHint,\n removedSection,\n publishSection,\n exportedSection,\n warningsSection,\n detailedFooter,\n ]);\n\n return { data, code: 0, details };\n}\n\n/** @deprecated use tagResultReport instead */\nexport function tagResultOutput(results: TagResults): string {\n const result = tagResultReport(results);\n return typeof result === 'string' ? result : result.details || result.data;\n}\n\nexport function compInBold(id: ComponentID): string {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n const items = ids.map((id) => formatItem(id.toStringWithoutVersion(), warnSymbol));\n return formatSection(label, '', items);\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;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,iBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA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AED;EAAQ,CAAC;AACnC;;AAEA;AACO,SAASE,eAAeA,CAACtG,OAAmB,EAAU;EAC3D,MAAMyC,MAAM,GAAGrC,eAAe,CAACJ,OAAO,CAAC;EACvC,OAAO,OAAOyC,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAAC2D,OAAO,IAAI3D,MAAM,CAAClI,IAAI;AAC5E;AAEO,SAAS8H,UAAUA,CAACN,EAAe,EAAU;EAClD,MAAMhC,OAAO,GAAGgC,EAAE,CAACwE,UAAU,CAAC,CAAC,GAAG,IAAIxE,EAAE,CAAChC,OAAO,EAAE,GAAG,EAAE;EACvD,OAAO,GAAGG,gBAAK,CAACwE,IAAI,CAAC3C,EAAE,CAACyE,sBAAsB,CAAC,CAAC,CAAC,GAAGzG,OAAO,EAAE;AAC/D;AAEO,SAAS0D,iBAAiBA,CAACgD,KAAa,EAAE3G,GAAqB,EAAE;EACtE,IAAI,CAACA,GAAG,EAAEiB,MAAM,EAAE,OAAO,EAAE;EAC3B,MAAM6C,KAAK,GAAG9D,GAAG,CAAC8C,GAAG,CAAEb,EAAE,IAAK,IAAAK,iBAAU,EAACL,EAAE,CAACyE,sBAAsB,CAAC,CAAC,EAAEzC,iBAAU,CAAC,CAAC;EAClF,OAAO,IAAAT,oBAAa,EAACmD,KAAK,EAAE,EAAE,EAAE7C,KAAK,CAAC;AACxC","ignoreList":[]}
@@ -1,8 +1,20 @@
1
- import type { ComponentIdList } from '@teambit/component-id';
1
+ import type { ComponentID, ComponentIdList } from '@teambit/component-id';
2
2
  import type { TagDataPerComp } from './snapping.main.runtime';
3
3
  export declare class VersionFileParser {
4
4
  private componentsToTag;
5
- constructor(componentsToTag: ComponentIdList);
5
+ /**
6
+ * a component that joined the batch on its own - the workspace root - rather than being tagged.
7
+ * the file is written for the components being tagged, so DEFAULT does not reach it. naming it
8
+ * on a line of its own still does.
9
+ */
10
+ private excludedFromDefault?;
11
+ constructor(componentsToTag: ComponentIdList,
12
+ /**
13
+ * a component that joined the batch on its own - the workspace root - rather than being tagged.
14
+ * the file is written for the components being tagged, so DEFAULT does not reach it. naming it
15
+ * on a line of its own still does.
16
+ */
17
+ excludedFromDefault?: ComponentID | undefined);
6
18
  parseVersionsFile(filePath: string): Promise<TagDataPerComp[]>;
7
19
  parseVersionsContent(fileContent: string): TagDataPerComp[];
8
20
  }
@@ -20,8 +20,15 @@ function _bitError() {
20
20
  }
21
21
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
22
  class VersionFileParser {
23
- constructor(componentsToTag) {
23
+ constructor(componentsToTag,
24
+ /**
25
+ * a component that joined the batch on its own - the workspace root - rather than being tagged.
26
+ * the file is written for the components being tagged, so DEFAULT does not reach it. naming it
27
+ * on a line of its own still does.
28
+ */
29
+ excludedFromDefault) {
24
30
  this.componentsToTag = componentsToTag;
31
+ this.excludedFromDefault = excludedFromDefault;
25
32
  }
26
33
  async parseVersionsFile(filePath) {
27
34
  if (!(await _fsExtra().default.pathExists(filePath))) {
@@ -92,6 +99,7 @@ class VersionFileParser {
92
99
  if (defaultVersion) {
93
100
  const specifiedIds = new Set(results.map(r => r.componentId.toStringWithoutVersion()));
94
101
  for (const componentId of this.componentsToTag) {
102
+ if (this.excludedFromDefault?.isEqualWithoutVersion(componentId)) continue;
95
103
  if (!specifiedIds.has(componentId.toStringWithoutVersion())) {
96
104
  let prereleaseId;
97
105
  if (defaultVersion.includes('-')) {
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bitError","e","__esModule","default","VersionFileParser","constructor","componentsToTag","parseVersionsFile","filePath","fs","pathExists","BitError","fileContent","readFile","parseVersionsContent","lines","split","map","line","trim","filter","startsWith","results","defaultVersion","componentsByName","Map","comp","set","toStringWithoutVersion","replace","colonIndex","indexOf","componentIdStr","substring","version","componentId","get","prereleaseId","includes","prereleaseMatch","match","push","dependencies","versionToTag","message","undefined","isNew","specifiedIds","Set","r","has","exports"],"sources":["version-file-parser.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport type { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { TagDataPerComp } from './snapping.main.runtime';\n\nexport class VersionFileParser {\n constructor(private componentsToTag: ComponentIdList) {}\n\n async parseVersionsFile(filePath: string): Promise<TagDataPerComp[]> {\n if (!(await fs.pathExists(filePath))) {\n throw new BitError(`versions file not found: ${filePath}`);\n }\n\n const fileContent = await fs.readFile(filePath, 'utf-8');\n return this.parseVersionsContent(fileContent);\n }\n\n parseVersionsContent(fileContent: string): TagDataPerComp[] {\n const lines = fileContent\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line && !line.startsWith('#'));\n\n const results: TagDataPerComp[] = [];\n let defaultVersion: string | undefined;\n\n // Create a map for faster component lookup\n const componentsByName = new Map<string, ComponentID>();\n for (const comp of this.componentsToTag) {\n componentsByName.set(comp.toStringWithoutVersion(), comp);\n }\n\n for (const line of lines) {\n // Handle default version\n if (line.startsWith('DEFAULT:')) {\n defaultVersion = line.replace('DEFAULT:', '').trim();\n if (!defaultVersion) {\n throw new BitError('DEFAULT version cannot be empty');\n }\n continue;\n }\n\n // Parse component line: \"component-id: version\"\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n const componentIdStr = line.substring(0, colonIndex).trim();\n const version = line.substring(colonIndex + 1).trim();\n\n if (!componentIdStr || !version) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n // Find the component ID in our list\n const componentId = componentsByName.get(componentIdStr);\n if (!componentId) {\n // Component not in the current tagging list - skip it\n continue;\n }\n\n // Extract prerelease ID if present\n let prereleaseId: string | undefined;\n if (version.includes('-')) {\n const prereleaseMatch = version.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [], // Will be populated by the calling code\n versionToTag: version,\n prereleaseId,\n message: undefined, // Messages handled separately via --message or --editor\n isNew: false, // Will be determined by the calling code\n });\n }\n\n // For components not specified in the file, use default version if provided\n if (defaultVersion) {\n const specifiedIds = new Set(results.map((r) => r.componentId.toStringWithoutVersion()));\n\n for (const componentId of this.componentsToTag) {\n if (!specifiedIds.has(componentId.toStringWithoutVersion())) {\n let prereleaseId: string | undefined;\n if (defaultVersion.includes('-')) {\n const prereleaseMatch = defaultVersion.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [],\n versionToTag: defaultVersion,\n prereleaseId,\n message: undefined,\n isNew: false,\n });\n }\n }\n }\n\n return results;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvC,MAAMG,iBAAiB,CAAC;EAC7BC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEvD,MAAMC,iBAAiBA,CAACC,QAAgB,EAA6B;IACnE,IAAI,EAAE,MAAMC,kBAAE,CAACC,UAAU,CAACF,QAAQ,CAAC,CAAC,EAAE;MACpC,MAAM,KAAIG,oBAAQ,EAAC,4BAA4BH,QAAQ,EAAE,CAAC;IAC5D;IAEA,MAAMI,WAAW,GAAG,MAAMH,kBAAE,CAACI,QAAQ,CAACL,QAAQ,EAAE,OAAO,CAAC;IACxD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C;UACF;UAEAjB,OAAO,CAACmB,IAAI,CAAC;YACXN,WAAW;YACXO,YAAY,EAAE,EAAE;YAChBC,YAAY,EAAEpB,cAAc;YAC5Bc,YAAY;YACZO,OAAO,EAAEC,SAAS;YAClBC,KAAK,EAAE;UACT,CAAC,CAAC;QACJ;MACF;IACF;IAEA,OAAOxB,OAAO;EAChB;AACF;AAAC6B,OAAA,CAAA/C,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bitError","e","__esModule","default","VersionFileParser","constructor","componentsToTag","excludedFromDefault","parseVersionsFile","filePath","fs","pathExists","BitError","fileContent","readFile","parseVersionsContent","lines","split","map","line","trim","filter","startsWith","results","defaultVersion","componentsByName","Map","comp","set","toStringWithoutVersion","replace","colonIndex","indexOf","componentIdStr","substring","version","componentId","get","prereleaseId","includes","prereleaseMatch","match","push","dependencies","versionToTag","message","undefined","isNew","specifiedIds","Set","r","isEqualWithoutVersion","has","exports"],"sources":["version-file-parser.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport type { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { TagDataPerComp } from './snapping.main.runtime';\n\nexport class VersionFileParser {\n constructor(\n private componentsToTag: ComponentIdList,\n /**\n * a component that joined the batch on its own - the workspace root - rather than being tagged.\n * the file is written for the components being tagged, so DEFAULT does not reach it. naming it\n * on a line of its own still does.\n */\n private excludedFromDefault?: ComponentID\n ) {}\n\n async parseVersionsFile(filePath: string): Promise<TagDataPerComp[]> {\n if (!(await fs.pathExists(filePath))) {\n throw new BitError(`versions file not found: ${filePath}`);\n }\n\n const fileContent = await fs.readFile(filePath, 'utf-8');\n return this.parseVersionsContent(fileContent);\n }\n\n parseVersionsContent(fileContent: string): TagDataPerComp[] {\n const lines = fileContent\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line && !line.startsWith('#'));\n\n const results: TagDataPerComp[] = [];\n let defaultVersion: string | undefined;\n\n // Create a map for faster component lookup\n const componentsByName = new Map<string, ComponentID>();\n for (const comp of this.componentsToTag) {\n componentsByName.set(comp.toStringWithoutVersion(), comp);\n }\n\n for (const line of lines) {\n // Handle default version\n if (line.startsWith('DEFAULT:')) {\n defaultVersion = line.replace('DEFAULT:', '').trim();\n if (!defaultVersion) {\n throw new BitError('DEFAULT version cannot be empty');\n }\n continue;\n }\n\n // Parse component line: \"component-id: version\"\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n const componentIdStr = line.substring(0, colonIndex).trim();\n const version = line.substring(colonIndex + 1).trim();\n\n if (!componentIdStr || !version) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n // Find the component ID in our list\n const componentId = componentsByName.get(componentIdStr);\n if (!componentId) {\n // Component not in the current tagging list - skip it\n continue;\n }\n\n // Extract prerelease ID if present\n let prereleaseId: string | undefined;\n if (version.includes('-')) {\n const prereleaseMatch = version.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [], // Will be populated by the calling code\n versionToTag: version,\n prereleaseId,\n message: undefined, // Messages handled separately via --message or --editor\n isNew: false, // Will be determined by the calling code\n });\n }\n\n // For components not specified in the file, use default version if provided\n if (defaultVersion) {\n const specifiedIds = new Set(results.map((r) => r.componentId.toStringWithoutVersion()));\n\n for (const componentId of this.componentsToTag) {\n if (this.excludedFromDefault?.isEqualWithoutVersion(componentId)) continue;\n if (!specifiedIds.has(componentId.toStringWithoutVersion())) {\n let prereleaseId: string | undefined;\n if (defaultVersion.includes('-')) {\n const prereleaseMatch = defaultVersion.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [],\n versionToTag: defaultVersion,\n prereleaseId,\n message: undefined,\n isNew: false,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iBAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ function _chai() {
4
+ const data = require("chai");
5
+ _chai = function () {
6
+ return data;
7
+ };
8
+ return data;
9
+ }
10
+ function _componentId() {
11
+ const data = require("@teambit/component-id");
12
+ _componentId = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _versionFileParser() {
18
+ const data = require("./version-file-parser");
19
+ _versionFileParser = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ describe('VersionFileParser', () => {
25
+ const member = _componentId().ComponentID.fromString('my-org.my-scope/my-comp');
26
+ const root = _componentId().ComponentID.fromString('my-org.my-scope/my-root');
27
+ const ids = _componentId().ComponentIdList.fromArray([member, root]);
28
+ const versionOf = (results, id) => results.find(result => result.componentId.isEqualWithoutVersion(id))?.versionToTag;
29
+ describe('a component excluded from DEFAULT, the way the workspace root is', () => {
30
+ it('should not get a version from the DEFAULT line', () => {
31
+ const parser = new (_versionFileParser().VersionFileParser)(ids, root);
32
+ const results = parser.parseVersionsContent('DEFAULT: 1.0.0');
33
+ (0, _chai().expect)(versionOf(results, member)).to.equal('1.0.0');
34
+ (0, _chai().expect)(versionOf(results, root)).to.be.undefined;
35
+ });
36
+ it('should get the version when the file names it, DEFAULT or not', () => {
37
+ const parser = new (_versionFileParser().VersionFileParser)(ids, root);
38
+ const results = parser.parseVersionsContent('DEFAULT: 1.0.0\nmy-org.my-scope/my-root: 2.0.0');
39
+ (0, _chai().expect)(versionOf(results, member)).to.equal('1.0.0');
40
+ (0, _chai().expect)(versionOf(results, root)).to.equal('2.0.0');
41
+ });
42
+ });
43
+ it('should give every component the DEFAULT when nothing is excluded', () => {
44
+ const results = new (_versionFileParser().VersionFileParser)(ids).parseVersionsContent('DEFAULT: 1.0.0');
45
+ (0, _chai().expect)(versionOf(results, member)).to.equal('1.0.0');
46
+ (0, _chai().expect)(versionOf(results, root)).to.equal('1.0.0');
47
+ });
48
+ });
49
+
50
+ //# sourceMappingURL=version-file-parser.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chai","data","require","_componentId","_versionFileParser","describe","member","ComponentID","fromString","root","ids","ComponentIdList","fromArray","versionOf","results","id","find","result","componentId","isEqualWithoutVersion","versionToTag","it","parser","VersionFileParser","parseVersionsContent","expect","to","equal","be","undefined"],"sources":["version-file-parser.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { VersionFileParser } from './version-file-parser';\n\ndescribe('VersionFileParser', () => {\n const member = ComponentID.fromString('my-org.my-scope/my-comp');\n const root = ComponentID.fromString('my-org.my-scope/my-root');\n const ids = ComponentIdList.fromArray([member, root]);\n const versionOf = (results: ReturnType<VersionFileParser['parseVersionsContent']>, id: ComponentID) =>\n results.find((result) => result.componentId.isEqualWithoutVersion(id))?.versionToTag;\n\n describe('a component excluded from DEFAULT, the way the workspace root is', () => {\n it('should not get a version from the DEFAULT line', () => {\n const parser = new VersionFileParser(ids, root);\n const results = parser.parseVersionsContent('DEFAULT: 1.0.0');\n expect(versionOf(results, member)).to.equal('1.0.0');\n expect(versionOf(results, root)).to.be.undefined;\n });\n it('should get the version when the file names it, DEFAULT or not', () => {\n const parser = new VersionFileParser(ids, root);\n const results = parser.parseVersionsContent('DEFAULT: 1.0.0\\nmy-org.my-scope/my-root: 2.0.0');\n expect(versionOf(results, member)).to.equal('1.0.0');\n expect(versionOf(results, root)).to.equal('2.0.0');\n });\n });\n\n it('should give every component the DEFAULT when nothing is excluded', () => {\n const results = new VersionFileParser(ids).parseVersionsContent('DEFAULT: 1.0.0');\n expect(versionOf(results, member)).to.equal('1.0.0');\n expect(versionOf(results, root)).to.equal('1.0.0');\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;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AiB,EAACb,GAAG,EAAED,IAAI,CAAC;MAC/C,MAAMK,OAAO,GAAGQ,MAAM,CAACE,oBAAoB,CAAC,gDAAgD,CAAC;MAC7F,IAAAC,cAAM,EAACZ,SAAS,CAACC,OAAO,EAAER,MAAM,CAAC,CAAC,CAACoB,EAAE,CAACC,KAAK,CAAC,OAAO,CAAC;MACpD,IAAAF,cAAM,EAACZ,SAAS,CAACC,OAAO,EAAEL,IAAI,CAAC,CAAC,CAACiB,EAAE,CAACC,KAAK,CAAC,OAAO,CAAC;IACpD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFN,EAAE,CAAC,kEAAkE,EAAE,MAAM;IAC3E,MAAMP,OAAO,GAAG,KAAIS,sCAAiB,EAACb,GAAG,CAAC,CAACc,oBAAoB,CAAC,gBAAgB,CAAC;IACjF,IAAAC,cAAM,EAACZ,SAAS,CAACC,OAAO,EAAER,MAAM,CAAC,CAAC,CAACoB,EAAE,CAACC,KAAK,CAAC,OAAO,CAAC;IACpD,IAAAF,cAAM,EAACZ,SAAS,CAACC,OAAO,EAAEL,IAAI,CAAC,CAAC,CAACiB,EAAE,CAACC,KAAK,CAAC,OAAO,CAAC;EACpD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -49,6 +49,11 @@ export type VersionMakerParams = {
49
49
  exitOnFirstFailedTask?: boolean;
50
50
  updateDependentsOnLane?: boolean;
51
51
  setHeadAsParent?: boolean;
52
+ /**
53
+ * the workspace-root component that joined the batch on its own, being new or modified. see
54
+ * SnappingMain.getWorkspaceRootToTagAlong.
55
+ */
56
+ autoAddedWorkspaceRoot?: ComponentID;
52
57
  } & BasicTagParams;
53
58
  /**
54
59
  * create a tag or a snap of the given components and save them in the local scope.
@@ -117,6 +122,20 @@ export declare class VersionMaker {
117
122
  */
118
123
  private emptyBuilderData;
119
124
  private updateDependenciesVersions;
125
+ /**
126
+ * every member of a workspace-root component records the root it is snapped in, at the version the
127
+ * root has after this batch: its new version when it is snapped along, otherwise the one in .bitmap.
128
+ * tag and snap bring a new or modified root into the batch (see SnappingMain.getWorkspaceRootToTagAlong),
129
+ * so the version is only missing on the paths that don't, such as a merge snap made while the root
130
+ * was never snapped. the root itself records nothing here, it carries the isRoot marker instead.
131
+ * see WorkspaceRootMain.
132
+ *
133
+ * a workspace with no root of its own writes nothing, and has nothing to undo either: aspect data is
134
+ * supplied fresh by the loader on every load rather than inherited from the version before it, so a
135
+ * component imported from a workspace that had a root arrives here without one. what does carry over
136
+ * is the extension's (empty) config, which is why the entry itself outlives the data it held.
137
+ */
138
+ private recordWorkspaceRoot;
120
139
  private addLogToComponents;
121
140
  }
122
141
  export type BitCloudUser = {
@@ -159,6 +159,13 @@ function _dependencyResolver() {
159
159
  };
160
160
  return data;
161
161
  }
162
+ function _workspaceRoot() {
163
+ const data = require("@teambit/workspace-root");
164
+ _workspaceRoot = function () {
165
+ return data;
166
+ };
167
+ return data;
168
+ }
162
169
  function _toolboxPromise() {
163
170
  const data = require("@teambit/toolbox.promise.map-pool");
164
171
  _toolboxPromise = function () {
@@ -223,6 +230,7 @@ class VersionMaker {
223
230
  this.params.isSnap ? this.setHashes() : await this.setFutureVersions(autoTagIds);
224
231
  // go through all dependencies and update their versions
225
232
  this.updateDependenciesVersions();
233
+ this.recordWorkspaceRoot();
226
234
  await this.addLogToComponents(componentsToTag, autoTagComponents, messagePerId);
227
235
  // don't move it down. otherwise, it'll be empty and we don't know which components were during merge.
228
236
  // (it's being deleted in snapping.main.runtime - `_addCompToObjects` method)
@@ -491,7 +499,7 @@ class VersionMaker {
491
499
  } = this.params;
492
500
  if (!versionsFile) return;
493
501
  const allComponentsToTag = _componentId().ComponentIdList.fromArray([...idsToTag, ...autoTagIds]);
494
- const versionFileParser = new (_versionFileParser().VersionFileParser)(allComponentsToTag);
502
+ const versionFileParser = new (_versionFileParser().VersionFileParser)(allComponentsToTag, this.params.autoAddedWorkspaceRoot);
495
503
  const tagDataFromFile = await versionFileParser.parseVersionsFile(versionsFile);
496
504
  this.params.tagDataPerComp = tagDataFromFile;
497
505
  }
@@ -585,9 +593,17 @@ class VersionMaker {
585
593
  const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);
586
594
  const modelComponent = await this.legacyScope.sources.findOrAddComponent(componentToTag);
587
595
  const nextVersion = componentToTag.componentMap?.nextVersion?.version;
596
+ const isAutoAddedRoot = Boolean(this.params.autoAddedWorkspaceRoot?.isEqualWithoutVersion(componentToTag.id));
597
+ // the root joined the batch on its own. a version given for the members - `--ver`, the id, or
598
+ // a versions-file DEFAULT - is not meant for it, so it is bumped the way an auto-tagged
599
+ // dependent is.
600
+ const bumpRootAsPatch = () => soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);
588
601
  const getNewVersion = () => {
589
602
  if (tagDataPerComp) {
590
603
  const tagData = tagDataPerComp.find(t => t.componentId.isEqualWithoutVersion(componentToTag.id));
604
+ // a versions file names the components being tagged. it covers the root only when it names
605
+ // it, see VersionFileParser - otherwise the root is still bumped on its own.
606
+ if (!tagData && isAutoAddedRoot) return bumpRootAsPatch();
591
607
  if (!tagData) throw new Error(`tag-data is missing for ${componentToTag.id.toStringWithoutVersion()}`);
592
608
  if (!tagData.versionToTag) throw new Error(`tag-data.TagResults is missing for ${componentToTag.id.toStringWithoutVersion()}`);
593
609
  const exactVersionOrReleaseType = (0, _pkgModules().getValidVersionOrReleaseType)(tagData.versionToTag);
@@ -608,6 +624,7 @@ class VersionMaker {
608
624
  }
609
625
  return soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);
610
626
  }
627
+ if (isAutoAddedRoot) return bumpRootAsPatch();
611
628
  const versionByEnteredId = this.getVersionByEnteredId(this.ids, componentToTag, modelComponent);
612
629
  return soft ? versionByEnteredId || exactVersion || releaseType : versionByEnteredId || modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);
613
630
  };
@@ -793,6 +810,39 @@ class VersionMaker {
793
810
  oneComponentToTag = updateDepsResolverData(oneComponentToTag);
794
811
  });
795
812
  }
813
+
814
+ /**
815
+ * every member of a workspace-root component records the root it is snapped in, at the version the
816
+ * root has after this batch: its new version when it is snapped along, otherwise the one in .bitmap.
817
+ * tag and snap bring a new or modified root into the batch (see SnappingMain.getWorkspaceRootToTagAlong),
818
+ * so the version is only missing on the paths that don't, such as a merge snap made while the root
819
+ * was never snapped. the root itself records nothing here, it carries the isRoot marker instead.
820
+ * see WorkspaceRootMain.
821
+ *
822
+ * a workspace with no root of its own writes nothing, and has nothing to undo either: aspect data is
823
+ * supplied fresh by the loader on every load rather than inherited from the version before it, so a
824
+ * component imported from a workspace that had a root arrives here without one. what does carry over
825
+ * is the extension's (empty) config, which is why the entry itself outlives the data it held.
826
+ */
827
+ recordWorkspaceRoot() {
828
+ const consumer = this.consumer;
829
+ if (!consumer) return;
830
+ const rootMap = (0, _workspaceRoot().findWorkspaceRootMap)(consumer.bitMap);
831
+ if (!rootMap) return;
832
+ const rootInBatch = this.allComponentsToTag.find(component => component.id.isEqualWithoutVersion(rootMap.id));
833
+ const rootId = rootInBatch ? rootInBatch.id.changeVersion(rootInBatch.version) : rootMap.id;
834
+ this.allComponentsToTag.forEach(component => {
835
+ // the root records no root of its own, it carries the isRoot marker the loader gives it
836
+ if (component.id.isEqualWithoutVersion(rootMap.id)) return;
837
+ // hidden lane entries (lane.updateDependents) cascade into the batch from the scope rather than
838
+ // from the workspace, so they were not snapped in this root. absence from .bitmap is how they
839
+ // are told apart elsewhere in this file as well
840
+ if (!consumer.bitMap.getComponentIfExist(component.id, {
841
+ ignoreVersion: true
842
+ })) return;
843
+ (0, _workspaceRoot().writeWorkspaceRoot)(component.extensions, rootId);
844
+ });
845
+ }
796
846
  async addLogToComponents(components, autoTagComps, messagePerComponent) {
797
847
  let {
798
848
  message