@teambit/snapping 1.0.1154 → 1.0.1156
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/published-versions.d.ts +74 -0
- package/dist/published-versions.js +236 -0
- package/dist/published-versions.js.map +1 -0
- package/dist/published-versions.spec.d.ts +1 -0
- package/dist/published-versions.spec.js +172 -0
- package/dist/published-versions.spec.js.map +1 -0
- package/dist/snapping.main.runtime.d.ts +1 -1
- package/dist/snapping.main.runtime.js +2 -0
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.js +3 -1
- package/dist/tag-cmd.js.map +1 -1
- package/dist/version-maker.d.ts +20 -0
- package/dist/version-maker.js +109 -3
- package/dist/version-maker.js.map +1 -1
- package/package.json +48 -44
- /package/dist/{preview-1788529038327.js → preview-1788575535452.js} +0 -0
package/dist/tag-cmd.js
CHANGED
|
@@ -66,7 +66,7 @@ function isPreReleaseType(releaseType) {
|
|
|
66
66
|
const tagCmdOptions = exports.tagCmdOptions = [['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).'], ['', 'versions-file <path>', 'path to a file containing component versions. format: "component-id: version"'], ['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>`'], ['', 'auto-tag-increment <level>', `the increment level to use for auto-tagged dependents. options are: [${RELEASE_TYPES.join(', ')}].
|
|
67
67
|
by default, dependents are bumped by a patch, unless --increment is one of [${PRE_RELEASE_TYPES.join(', ')}], which they follow.
|
|
68
68
|
note that dependents are auto-tagged transitively, so the entire dependents graph is bumped by this level`], ['', '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.
|
|
69
|
-
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'], ['', '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'], ['', 'no-lock-deps', 'do not save the dependencies graph in the tag'], ['', '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:
|
|
69
|
+
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'], ['', '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'], ['', 'no-lock-deps', 'do not save the dependencies graph in the tag'], ['', '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.'], ['', 'skip-published-versions', 'skip versions that are already in the registry. useful when a previous run published the packages but failed before exporting'], ['i', 'ignore-issues <issues>', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
70
70
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
71
71
|
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.'], ['', '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'], ['', 'loose', 'allow tag --build to succeed even if tasks like tests or lint fail'], ['', 'detach-head', 'UNSUPPORTED YET. in case a component is checked out to an older version, tag it without changing the head']];
|
|
72
72
|
class TagCmd {
|
|
@@ -119,6 +119,7 @@ use for official releases. for development versions, use 'bit snap' instead.`);
|
|
|
119
119
|
noLockDeps = false,
|
|
120
120
|
failFast = false,
|
|
121
121
|
incrementBy = 1,
|
|
122
|
+
skipPublishedVersions = false,
|
|
122
123
|
detachHead,
|
|
123
124
|
loose = false
|
|
124
125
|
} = options;
|
|
@@ -168,6 +169,7 @@ To undo local tag use the "bit reset" command.`);
|
|
|
168
169
|
rebuildDepsGraph,
|
|
169
170
|
noLockDeps,
|
|
170
171
|
incrementBy,
|
|
172
|
+
skipPublishedVersions,
|
|
171
173
|
version: ver,
|
|
172
174
|
failFast,
|
|
173
175
|
detachHead,
|
package/dist/tag-cmd.js.map
CHANGED
|
@@ -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","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 '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 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 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,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;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAO,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,CAAA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,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","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,OAAA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,MAAMoJ,OAAO,GAAG,IAAAJ,mBAAY,EAAC,CAC3BC,WAAW,EACXC,eAAe,EACfxC,cAAc,EACdE,cAAc,EACdI,eAAe,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":[]}
|
package/dist/version-maker.d.ts
CHANGED
|
@@ -30,6 +30,10 @@ export type BasicTagParams = BasicTagSnapParams & {
|
|
|
30
30
|
versionsFile?: string;
|
|
31
31
|
unmodified?: boolean;
|
|
32
32
|
ignoreIssues?: string;
|
|
33
|
+
/**
|
|
34
|
+
* when the computed version is already in the registry, tag the next version that isn't.
|
|
35
|
+
*/
|
|
36
|
+
skipPublishedVersions?: boolean;
|
|
33
37
|
};
|
|
34
38
|
export type VersionMakerParams = {
|
|
35
39
|
tagDataPerComp?: TagDataPerComp[];
|
|
@@ -87,6 +91,22 @@ export declare class VersionMaker {
|
|
|
87
91
|
private getAutoTagData;
|
|
88
92
|
private getLaneAutoTagIdsFromScope;
|
|
89
93
|
private setFutureVersions;
|
|
94
|
+
/**
|
|
95
|
+
* a version that is already in the registry can't be published again, so tagging it only fails
|
|
96
|
+
* later on, during the publish task. see `published-versions.ts` for how the registry gets ahead
|
|
97
|
+
* of the scope in the first place, and why a probe is enough to detect it.
|
|
98
|
+
*
|
|
99
|
+
* only derived versions are checked. a version given explicitly - `--ver`, a versions file, or
|
|
100
|
+
* on the id itself ("foo@1.2.3") - is tagged as given, the registry is not consulted for it.
|
|
101
|
+
*
|
|
102
|
+
* @returns the version to tag instead, by component id, for the components that collided.
|
|
103
|
+
*/
|
|
104
|
+
private getVersionsPublishedToRegistry;
|
|
105
|
+
/**
|
|
106
|
+
* whether the version was given by the user for this specific component: on the id ("foo@1.2.3")
|
|
107
|
+
* or on the soft-tag now being persisted. `--ver` and a versions file are explicit for the whole run.
|
|
108
|
+
*/
|
|
109
|
+
private hasExplicitVersion;
|
|
90
110
|
private setCurrentSchema;
|
|
91
111
|
private setHashes;
|
|
92
112
|
private getVersionByEnteredId;
|
package/dist/version-maker.js
CHANGED
|
@@ -75,6 +75,13 @@ function _remove() {
|
|
|
75
75
|
};
|
|
76
76
|
return data;
|
|
77
77
|
}
|
|
78
|
+
function _cli() {
|
|
79
|
+
const data = require("@teambit/cli");
|
|
80
|
+
_cli = function () {
|
|
81
|
+
return data;
|
|
82
|
+
};
|
|
83
|
+
return data;
|
|
84
|
+
}
|
|
78
85
|
function _pkgModules() {
|
|
79
86
|
const data = require("@teambit/pkg.modules.semver-helper");
|
|
80
87
|
_pkgModules = function () {
|
|
@@ -82,6 +89,20 @@ function _pkgModules() {
|
|
|
82
89
|
};
|
|
83
90
|
return data;
|
|
84
91
|
}
|
|
92
|
+
function _pkgModules2() {
|
|
93
|
+
const data = require("@teambit/pkg.modules.component-package-name");
|
|
94
|
+
_pkgModules2 = function () {
|
|
95
|
+
return data;
|
|
96
|
+
};
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
function _pkg() {
|
|
100
|
+
const data = require("@teambit/pkg");
|
|
101
|
+
_pkg = function () {
|
|
102
|
+
return data;
|
|
103
|
+
};
|
|
104
|
+
return data;
|
|
105
|
+
}
|
|
85
106
|
function _harmonyModules() {
|
|
86
107
|
const data = require("@teambit/harmony.modules.get-basic-log");
|
|
87
108
|
_harmonyModules = function () {
|
|
@@ -124,6 +145,13 @@ function _versionFileParser() {
|
|
|
124
145
|
};
|
|
125
146
|
return data;
|
|
126
147
|
}
|
|
148
|
+
function _publishedVersions() {
|
|
149
|
+
const data = require("./published-versions");
|
|
150
|
+
_publishedVersions = function () {
|
|
151
|
+
return data;
|
|
152
|
+
};
|
|
153
|
+
return data;
|
|
154
|
+
}
|
|
127
155
|
function _dependencyResolver() {
|
|
128
156
|
const data = require("@teambit/dependency-resolver");
|
|
129
157
|
_dependencyResolver = function () {
|
|
@@ -553,7 +581,7 @@ class VersionMaker {
|
|
|
553
581
|
preReleaseId
|
|
554
582
|
} = this.params;
|
|
555
583
|
const isPreReleaseLike = releaseType ? ['prerelease', 'premajor', 'preminor', 'prepatch'].includes(releaseType) : false;
|
|
556
|
-
await Promise.all(this.allComponentsToTag.map(async componentToTag => {
|
|
584
|
+
const computedVersions = await Promise.all(this.allComponentsToTag.map(async componentToTag => {
|
|
557
585
|
const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);
|
|
558
586
|
const modelComponent = await this.legacyScope.sources.findOrAddComponent(componentToTag);
|
|
559
587
|
const nextVersion = componentToTag.componentMap?.nextVersion?.version;
|
|
@@ -583,9 +611,87 @@ class VersionMaker {
|
|
|
583
611
|
const versionByEnteredId = this.getVersionByEnteredId(this.ids, componentToTag, modelComponent);
|
|
584
612
|
return soft ? versionByEnteredId || exactVersion || releaseType : versionByEnteredId || modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);
|
|
585
613
|
};
|
|
586
|
-
|
|
587
|
-
|
|
614
|
+
return {
|
|
615
|
+
componentToTag,
|
|
616
|
+
version: getNewVersion()
|
|
617
|
+
};
|
|
588
618
|
}));
|
|
619
|
+
const versionsToSkip = await this.getVersionsPublishedToRegistry(computedVersions);
|
|
620
|
+
computedVersions.forEach(({
|
|
621
|
+
componentToTag,
|
|
622
|
+
version
|
|
623
|
+
}) => {
|
|
624
|
+
componentToTag.setNewVersion(versionsToSkip.get(componentToTag.id.toStringWithoutVersion()) || version);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* a version that is already in the registry can't be published again, so tagging it only fails
|
|
630
|
+
* later on, during the publish task. see `published-versions.ts` for how the registry gets ahead
|
|
631
|
+
* of the scope in the first place, and why a probe is enough to detect it.
|
|
632
|
+
*
|
|
633
|
+
* only derived versions are checked. a version given explicitly - `--ver`, a versions file, or
|
|
634
|
+
* on the id itself ("foo@1.2.3") - is tagged as given, the registry is not consulted for it.
|
|
635
|
+
*
|
|
636
|
+
* @returns the version to tag instead, by component id, for the components that collided.
|
|
637
|
+
*/
|
|
638
|
+
async getVersionsPublishedToRegistry(computedVersions) {
|
|
639
|
+
const {
|
|
640
|
+
soft,
|
|
641
|
+
exactVersion,
|
|
642
|
+
tagDataPerComp
|
|
643
|
+
} = this.params;
|
|
644
|
+
// on a soft-tag the "version" is a release-type (e.g. "patch"), there is nothing to look up yet.
|
|
645
|
+
if (!this.params.skipPublishedVersions || soft || exactVersion || tagDataPerComp) return new Map();
|
|
646
|
+
// only an external registry can get ahead of the scope: a component published to bit's own
|
|
647
|
+
// registry gets there during the export itself, so the export failing leaves nothing behind.
|
|
648
|
+
// by default nothing is published externally, which makes this a no-op for most workspaces.
|
|
649
|
+
const candidates = computedVersions.flatMap(({
|
|
650
|
+
componentToTag,
|
|
651
|
+
version
|
|
652
|
+
}) => {
|
|
653
|
+
if (this.hasExplicitVersion(componentToTag)) return [];
|
|
654
|
+
const pkgConfig = componentToTag.extensions.findExtension(_pkg().PkgAspect.id)?.config;
|
|
655
|
+
if (!(0, _pkg().shouldPublishToExternalRegistry)(pkgConfig)) return [];
|
|
656
|
+
return [{
|
|
657
|
+
id: componentToTag.id.toStringWithoutVersion(),
|
|
658
|
+
packageName: (0, _pkgModules2().componentIdToPackageName)(componentToTag),
|
|
659
|
+
version,
|
|
660
|
+
registryUrl: (0, _pkg().getPublishRegistry)(pkgConfig)
|
|
661
|
+
}];
|
|
662
|
+
});
|
|
663
|
+
if (!candidates.length) return new Map();
|
|
664
|
+
let registries;
|
|
665
|
+
try {
|
|
666
|
+
registries = await this.dependencyResolver.getRegistries();
|
|
667
|
+
} catch (err) {
|
|
668
|
+
// skipping published versions is a safety net for a stuck release, never a reason to fail one.
|
|
669
|
+
this.snapping.logger.console((0, _cli().formatWarningSummary)(`unable to check the registry for published versions, tagging without it: ${err.message}`));
|
|
670
|
+
return new Map();
|
|
671
|
+
}
|
|
672
|
+
const skipped = await (0, _publishedVersions().skipPublishedVersions)(candidates, (0, _publishedVersions().createIsVersionPublished)(registries, this.snapping.logger));
|
|
673
|
+
if (skipped.length) {
|
|
674
|
+
// one section rather than a line per component: a run that got stuck can collide on all of them
|
|
675
|
+
this.snapping.logger.console((0, _cli().formatSection)('Versions already in the registry', 'an earlier run published these versions, tagging the next free one instead', skipped.map(({
|
|
676
|
+
packageName,
|
|
677
|
+
version,
|
|
678
|
+
versionToTag
|
|
679
|
+
}) => (0, _cli().formatItem)(`${packageName}: ${version} is taken, tagging ${versionToTag}`))));
|
|
680
|
+
}
|
|
681
|
+
return new Map(skipped.map(({
|
|
682
|
+
id,
|
|
683
|
+
versionToTag
|
|
684
|
+
}) => [id, versionToTag]));
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* whether the version was given by the user for this specific component: on the id ("foo@1.2.3")
|
|
689
|
+
* or on the soft-tag now being persisted. `--ver` and a versions file are explicit for the whole run.
|
|
690
|
+
*/
|
|
691
|
+
hasExplicitVersion(componentToTag) {
|
|
692
|
+
const enteredVersion = this.ids.searchWithoutVersion(componentToTag.id)?.version;
|
|
693
|
+
const softTagVersion = this.params.persist ? componentToTag.componentMap?.nextVersion?.version : undefined;
|
|
694
|
+
return [enteredVersion, softTagVersion].some(given => given && Boolean((0, _pkgModules().getValidVersionOrReleaseType)(given).exactVersion));
|
|
589
695
|
}
|
|
590
696
|
setCurrentSchema() {
|
|
591
697
|
this.allComponentsToTag.forEach(component => {
|