@teambit/snapping 1.0.638 → 1.0.640
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/snap-cmd.d.ts +1 -1
- package/dist/snap-cmd.js +5 -3
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +2 -2
- package/dist/snapping.main.runtime.js +8 -4
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.d.ts +1 -0
- package/dist/tag-cmd.js +5 -3
- package/dist/tag-cmd.js.map +1 -1
- package/dist/version-maker.d.ts +1 -0
- package/dist/version-maker.js +6 -13
- package/dist/version-maker.js.map +1 -1
- package/package.json +34 -35
- /package/dist/{preview-1750821706704.js → preview-1750994319833.js} +0 -0
package/dist/tag-cmd.js
CHANGED
|
@@ -46,7 +46,7 @@ const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepa
|
|
|
46
46
|
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).'], ['v', 'ver <version>', 'tag with the given version'], ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`], ['', 'prerelease-id <id>', 'prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")'], ['p', 'patch', 'syntactic sugar for "--increment patch"'], ['', 'minor', 'syntactic sugar for "--increment minor"'], ['', 'major', 'syntactic sugar for "--increment major"'], ['', 'pre-release [identifier]', 'syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`'], ['', 'snapped', 'tag only components whose head is a snap (not a tag)'], ['', 'unmerged', 'complete a merge process by tagging the unmerged components'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-tasks <string>', `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.
|
|
47
47
|
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'], ['', '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:
|
|
48
48
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
49
|
-
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'], ['', 'detach-head', 'UNSUPPORTED YET. in case a component is checked out to an older version, tag it without changing the head']];
|
|
49
|
+
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']];
|
|
50
50
|
class TagCmd {
|
|
51
51
|
constructor(snapping, logger, configStore) {
|
|
52
52
|
this.snapping = snapping;
|
|
@@ -94,7 +94,8 @@ if patterns are entered, you can specify a version per pattern using "@" sign, e
|
|
|
94
94
|
rebuildDepsGraph,
|
|
95
95
|
failFast = false,
|
|
96
96
|
incrementBy = 1,
|
|
97
|
-
detachHead
|
|
97
|
+
detachHead,
|
|
98
|
+
loose = false
|
|
98
99
|
} = options;
|
|
99
100
|
if (!message && !persist && !editor) {
|
|
100
101
|
this.logger.consoleWarning(`--message will be mandatory in the next few releases. make sure to add a message with your tag`);
|
|
@@ -140,7 +141,8 @@ To undo local tag use the "bit reset" command.`);
|
|
|
140
141
|
incrementBy,
|
|
141
142
|
version: ver,
|
|
142
143
|
failFast,
|
|
143
|
-
detachHead
|
|
144
|
+
detachHead,
|
|
145
|
+
loose
|
|
144
146
|
};
|
|
145
147
|
const results = await this.snapping.tag(params);
|
|
146
148
|
if (!results) return _chalk().default.yellow(persist ? 'no soft-tag found' : NOTHING_TO_TAG_MSG);
|
package/dist/tag-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_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","tagCmdOptions","join","keys","IssuesClasses","TagCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","cmd","report","patterns","options","message","ver","editor","snapped","unmerged","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","soft","persist","disableTagPipeline","ignoreBuildErrors","rebuildDepsGraph","failFast","incrementBy","detachHead","consoleWarning","releaseType","preReleaseId","validateOptions","disableTagAndSnapPipelines","build","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","params","ids","version","results","tag","chalk","yellow","tagResultOutput","patch","minor","major","preRelease","increment","prereleaseId","releaseFlags","filter","x","length","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","exportedIds","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","compInBold","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","exportedOutput","title","underline","softTagPrefix","outputIfExists","label","explanation","components","newDesc","changedDesc","softTagClarification","outputIdsIfExists"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ConsumerComponent } from '@teambit/legacy.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 { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TagResults, SnappingMain } from './snapping.main.runtime';\nimport { BasicTagParams } from './version-maker';\nimport { 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'];\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 ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'tag only components whose head is a snap (not a tag)'],\n ['', 'unmerged', 'complete a merge process by tagging the unmerged components'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n [\n '',\n 'persist [skip-build]',\n 'persist the changes generated by --soft tag. by default, run the build pipeline, unless \"skip-build\" is provided',\n ],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'ignore-build-errors', 'proceed to tag pipeline even when build pipeline fails'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n ['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 [\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 preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n} & Partial<BasicTagParams>;\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'version-control';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = 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> {\n const {\n message = '',\n ver,\n editor = '',\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 failFast = false,\n incrementBy = 1,\n detachHead,\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, 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 message,\n releaseType,\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 incrementBy,\n version: ver,\n failFast,\n detachHead,\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 tagResultOutput(results);\n }\n}\n\nexport function validateOptions(options: TagParams) {\n const { patch, minor, major, preRelease, increment, prereleaseId } = options;\n if (prereleaseId && (!increment || increment === 'major' || increment === 'minor' || increment === 'patch')) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment flag, while --increment must be one of the following: [prepatch, prerelease, preminor, premajor]`\n );\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\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 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 preReleaseId: getPreReleaseId(),\n };\n}\n\nexport function tagResultOutput(results: TagResults): string {\n const { taggedComponents, autoTaggedResults, warnings, newComponents, removedComponents, exportedIds }: TagResults =\n results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = exportedIds\n ? ''\n : `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the soft-tagged changes as a fully tagged version\")\n(use \"bit reset --soft\" to remove the soft-tags)`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoTaggedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const exportedOutput = () => {\n if (!exportedIds) return '';\n if (!exportedIds.length) return `\\n${chalk.yellow('no component has been exported')}\\n`;\n const title = `\\n${chalk.underline('exported components')}\\n`;\n const ids = exportedIds.map((id) => ` > ${compInBold(id)}`).join('\\n');\n return `${title}${ids}\\n`;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label: string, explanation: string, components: ConsumerComponent[]) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged with first version for components when persisted'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that are set to get a version bump when persisted'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n '\\nkeep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n publishOutput() +\n exportedOutput() +\n warningsOutput +\n chalk.green(\n `\\n${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged${\n exportedIds ? ' and exported' : ''\n }`\n ) +\n tagExplanation +\n softTagClarification\n );\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n return `\\n${chalk.underline(label)}\\n${ids.map((id) => id.toStringWithoutVersion()).join('\\n')}\\n`;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;A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KAAK,CAAC,MAAMC,WAAW,MAAMrB,gBAAgB,CAACsB,UAAU,CAAC,IAAI;EAC3G,CAAC;EAED,MAAMC,OAAO,GAAGhE,OAAO,CAACoC,SAAS,GAC7B,mEAAmE,GACnE,8BAA8B;EAClC,MAAM6B,WAAW,GAAGjE,OAAO,CAACoC,SAAS,GACjC,8DAA8D,GAC9D,oCAAoC;EACxC,MAAM8B,oBAAoB,GAAGlE,OAAO,CAACoC,SAAS,GAC1ClC,gBAAK,CAACqC,IAAI,CACR,mHACF,CAAC,GACD,EAAE;EACN,OACEqB,cAAc,CAAC,gBAAgB,EAAEI,OAAO,EAAElC,eAAe,CAAC,GAC1D8B,cAAc,CAAC,oBAAoB,EAAEK,WAAW,EAAEvC,iBAAiB,CAAC,GACpEyC,iBAAiB,CAAC,oBAAoB,EAAE3C,iBAAiB,CAAC,GAC1D0B,aAAa,CAAC,CAAC,GACfM,cAAc,CAAC,CAAC,GAChBxB,cAAc,GACd9B,gBAAK,CAACmD,KAAK,CACT,KAAKjC,gBAAgB,CAACN,MAAM,GAAGiB,eAAe,iBAAiB/B,OAAO,CAACoC,SAAS,GAAG,OAAO,GAAG,EAAE,SAC7FX,WAAW,GAAG,eAAe,GAAG,EAAE,EAEtC,CAAC,GACDU,cAAc,GACd+B,oBAAoB;AAExB;AAEO,SAASC,iBAAiBA,CAACN,KAAa,EAAE/D,GAAqB,EAAE;EACtE,IAAI,CAACA,GAAG,EAAEgB,MAAM,EAAE,OAAO,EAAE;EAC3B,OAAO,KAAKZ,gBAAK,CAACwD,SAAS,CAACG,KAAK,CAAC,KAAK/D,GAAG,CAAC6C,GAAG,CAAEd,EAAE,IAAKA,EAAE,CAACW,sBAAsB,CAAC,CAAC,CAAC,CAACvF,IAAI,CAAC,IAAI,CAAC,IAAI;AACpG","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_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","tagCmdOptions","join","keys","IssuesClasses","TagCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","cmd","report","patterns","options","message","ver","editor","snapped","unmerged","ignoreIssues","ignoreNewestVersion","skipTests","skipTasks","skipAutoTag","unmodified","soft","persist","disableTagPipeline","ignoreBuildErrors","rebuildDepsGraph","failFast","incrementBy","detachHead","loose","consoleWarning","releaseType","preReleaseId","validateOptions","disableTagAndSnapPipelines","build","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","params","ids","version","results","tag","chalk","yellow","tagResultOutput","patch","minor","major","preRelease","increment","prereleaseId","releaseFlags","filter","x","length","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","taggedComponents","autoTaggedResults","warnings","newComponents","removedComponents","exportedIds","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","compInBold","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","exportedOutput","title","underline","softTagPrefix","outputIfExists","label","explanation","components","newDesc","changedDesc","softTagClarification","outputIdsIfExists"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ConsumerComponent } from '@teambit/legacy.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 { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TagResults, SnappingMain } from './snapping.main.runtime';\nimport { BasicTagParams } from './version-maker';\nimport { 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'];\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 ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'tag only components whose head is a snap (not a tag)'],\n ['', 'unmerged', 'complete a merge process by tagging the unmerged components'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n [\n '',\n 'persist [skip-build]',\n 'persist the changes generated by --soft tag. by default, run the build pipeline, unless \"skip-build\" is provided',\n ],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'ignore-build-errors', 'proceed to tag pipeline even when build pipeline fails'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n ['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 preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n incrementBy?: number;\n failFast?: boolean;\n disableTagPipeline?: boolean;\n loose?: boolean;\n} & Partial<BasicTagParams>;\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'version-control';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified are tagged.`,\n },\n ];\n helpUrl = 'reference/components/snaps#create-a-tag-(release-version)';\n alias = 't';\n loader = true;\n options = 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> {\n const {\n message = '',\n ver,\n editor = '',\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 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, 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 message,\n releaseType,\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 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 tagResultOutput(results);\n }\n}\n\nexport function validateOptions(options: TagParams) {\n const { patch, minor, major, preRelease, increment, prereleaseId } = options;\n if (prereleaseId && (!increment || increment === 'major' || increment === 'minor' || increment === 'patch')) {\n throw new BitError(\n `--prerelease-id should be entered along with --increment flag, while --increment must be one of the following: [prepatch, prerelease, preminor, premajor]`\n );\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\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 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 preReleaseId: getPreReleaseId(),\n };\n}\n\nexport function tagResultOutput(results: TagResults): string {\n const { taggedComponents, autoTaggedResults, warnings, newComponents, removedComponents, exportedIds }: TagResults =\n results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = exportedIds\n ? ''\n : `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the soft-tagged changes as a fully tagged version\")\n(use \"bit reset --soft\" to remove the soft-tags)`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoTaggedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const exportedOutput = () => {\n if (!exportedIds) return '';\n if (!exportedIds.length) return `\\n${chalk.yellow('no component has been exported')}\\n`;\n const title = `\\n${chalk.underline('exported components')}\\n`;\n const ids = exportedIds.map((id) => ` > ${compInBold(id)}`).join('\\n');\n return `${title}${ids}\\n`;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label: string, explanation: string, components: ConsumerComponent[]) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged with first version for components when persisted'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that are set to get a version bump when persisted'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n '\\nkeep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n publishOutput() +\n exportedOutput() +\n warningsOutput +\n chalk.green(\n `\\n${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged${\n exportedIds ? ' and exported' : ''\n }`\n ) +\n tagExplanation +\n softTagClarification\n );\n}\n\nexport function outputIdsIfExists(label: string, ids?: ComponentIdList) {\n if (!ids?.length) return '';\n return `\\n${chalk.underline(label)}\\n${ids.map((id) => id.toStringWithoutVersion()).join('\\n')}\\n`;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,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C,GAC1D0B,aAAa,CAAC,CAAC,GACfM,cAAc,CAAC,CAAC,GAChBxB,cAAc,GACd9B,gBAAK,CAACmD,KAAK,CACT,KAAKjC,gBAAgB,CAACN,MAAM,GAAGiB,eAAe,iBAAiB/B,OAAO,CAACoC,SAAS,GAAG,OAAO,GAAG,EAAE,SAC7FX,WAAW,GAAG,eAAe,GAAG,EAAE,EAEtC,CAAC,GACDU,cAAc,GACd+B,oBAAoB;AAExB;AAEO,SAASC,iBAAiBA,CAACN,KAAa,EAAE/D,GAAqB,EAAE;EACtE,IAAI,CAACA,GAAG,EAAEgB,MAAM,EAAE,OAAO,EAAE;EAC3B,OAAO,KAAKZ,gBAAK,CAACwD,SAAS,CAACG,KAAK,CAAC,KAAK/D,GAAG,CAAC6C,GAAG,CAAEd,EAAE,IAAKA,EAAE,CAACW,sBAAsB,CAAC,CAAC,CAAC,CAACxF,IAAI,CAAC,IAAI,CAAC,IAAI;AACpG","ignoreList":[]}
|
package/dist/version-maker.d.ts
CHANGED
package/dist/version-maker.js
CHANGED
|
@@ -131,13 +131,6 @@ function _toolboxPromise() {
|
|
|
131
131
|
};
|
|
132
132
|
return data;
|
|
133
133
|
}
|
|
134
|
-
function _harmonyModules2() {
|
|
135
|
-
const data = require("@teambit/harmony.modules.feature-toggle");
|
|
136
|
-
_harmonyModules2 = function () {
|
|
137
|
-
return data;
|
|
138
|
-
};
|
|
139
|
-
return data;
|
|
140
|
-
}
|
|
141
134
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
142
135
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
143
136
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -331,14 +324,16 @@ class VersionMaker {
|
|
|
331
324
|
packageManagerConfigRootDir,
|
|
332
325
|
exitOnFirstFailedTask,
|
|
333
326
|
populateArtifactsIgnorePkgJson,
|
|
334
|
-
skipTests
|
|
327
|
+
skipTests,
|
|
328
|
+
loose
|
|
335
329
|
} = this.params;
|
|
336
330
|
const onTagOpts = {
|
|
337
331
|
disableTagAndSnapPipelines,
|
|
338
332
|
throwOnError: true,
|
|
339
333
|
forceDeploy: ignoreBuildErrors,
|
|
340
334
|
isSnap,
|
|
341
|
-
populateArtifactsFrom
|
|
335
|
+
populateArtifactsFrom,
|
|
336
|
+
loose
|
|
342
337
|
};
|
|
343
338
|
const skipTasksParsed = skipTasks ? skipTasks.split(',').map(t => t.trim()) : undefined;
|
|
344
339
|
const seedersOnly = !this.workspace; // if tag from scope, build only the given components
|
|
@@ -350,7 +345,8 @@ class VersionMaker {
|
|
|
350
345
|
const builderOptions = {
|
|
351
346
|
exitOnFirstFailedTask,
|
|
352
347
|
skipTests,
|
|
353
|
-
skipTasks: skipTasksParsed
|
|
348
|
+
skipTasks: skipTasksParsed,
|
|
349
|
+
loose
|
|
354
350
|
};
|
|
355
351
|
const componentsToBuild = harmonyCompsToTag.filter(c => !c.isDeleted());
|
|
356
352
|
if (componentsToBuild.length) {
|
|
@@ -380,9 +376,6 @@ class VersionMaker {
|
|
|
380
376
|
ignoreNewestVersion,
|
|
381
377
|
isSnap
|
|
382
378
|
} = this.params;
|
|
383
|
-
if (detachHead && !(0, _harmonyModules2().isFeatureEnabled)(_harmonyModules2().DETACH_HEAD)) {
|
|
384
|
-
throw new Error('unable to detach head, the feature is not enabled');
|
|
385
|
-
}
|
|
386
379
|
if (ignoreNewestVersion && !detachHead) this.params.overrideHead = true;
|
|
387
380
|
if (!ignoreNewestVersion && !isSnap) {
|
|
388
381
|
await throwForNewestVersion(this.allComponentsToTag, this.legacyScope);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_uuid","_bitError","_componentId","_legacy","_legacy2","_workspaceModules","_legacy3","_remove","_pkgModules","_harmonyModules","_toolboxCrypto","_componentVersion","_objects","_messagePerComponent","_dependencyResolver","_toolboxPromise","_harmonyModules2","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","VersionMaker","constructor","snapping","components","consumerComponents","ids","params","workspace","scope","builder","dependencyResolver","consumer","legacyScope","makeVersion","allWorkspaceComps","list","undefined","componentsToTag","getUniqCompsToTag","idsToTag","ComponentIdList","fromArray","map","c","id","autoTagData","getAutoTagData","autoTagComponents","autoTagItem","component","autoTagComponentsFiltered","filter","has","autoTagIds","autoTag","triggerOnPreSnap","allComponentsToTag","messagePerId","getMessagePerId","checkForNewerVersions","setCurrentSchema","isSnap","setHashes","setFutureVersions","updateDependenciesVersions","addLogToComponents","unmergedComps","listComponentsDuringMerge","lane","getCurrentLaneObject","stagedConfig","getStagedConfig","soft","Error","updateNextVersionOnBitmap","preReleaseId","taggedComponents","autoTaggedResults","publishedPackages","rebuildDepsGraph","build","updateDependentsOnLane","setHeadAsParent","detachHead","overrideHead","_addFlattenedDependenciesToComponents","_addDependenciesGraphToComponents","throwForDepsFromAnotherLane","emptyBuilderData","addBuildStatus","BuildStatus","Pending","currentLane","getCurrentLaneId","mapSeries","results","_addCompToObjects","source","shouldValidateVersion","Boolean","addVersionOpts","addToUpdateDependentsInLane","modelComponent","getModelComponent","updateVersions","addedVersionStr","tagData","tagDataPerComp","find","componentId","isEqualWithoutVersion","isNew","version","removeAllParents","stagedSnaps","write","harmonyCompsToTag","getManyByLegacy","state","_consumer","removedComponents","removeDeletedComponentsFromBitmap","addLaneObject","objects","persist","removeMergeConfigFromComponents","linkToNodeModulesByComponents","clearObjectsFromCache","logger","setStatusLine","profile","componentIdByPkgName","_getComponentIdByPkgNameMap","options","rootDir","path","rootComponentsPath","pMapPool","consumerComponent","_findWorkspaceCompByConsumerComp","componentMap","addDependenciesGraph","concurrency","clearStatusLine","Map","forEach","pkgName","getPackageName","set","workspaceComp","every","snappedComponent","allFunctions","onPreSnapSlot","values","func","message","msgStr","laneHistory","lanes","updateLaneHistory","add","disableTagAndSnapPipelines","ignoreBuildErrors","populateArtifactsFrom","skipTasks","packageManagerConfigRootDir","exitOnFirstFailedTask","populateArtifactsIgnorePkgJson","skipTests","onTagOpts","throwOnError","forceDeploy","skipTasksParsed","split","trim","seedersOnly","isolateOptions","builderOptions","componentsToBuild","isDeleted","length","componentsToBuildLegacy","reloadAspectsWithNewVersion","builderDataMap","tagListener","buildResult","builderDataMapToLegacyOnTagResults","_updateComponentsByTagResult","packageIntegritiesByPublishedPackages","_getPublishedPackages","push","Array","from","keys","addIntegritiesToConsumerComponentsGraphs","Succeed","comp","enrichComp","updateHiddenProp","ignoreNewestVersion","isFeatureEnabled","DETACH_HEAD","throwForNewestVersion","messagesFromEditorFetcher","MessagePerComponentFetcher","editor","getMessagesFromEditor","tmp","msg","consumerComponentsIdsMap","componentIdString","toString","skipAutoTag","getLaneAutoTagIdsFromScope","idsToTriggerAutoTag","hasVersion","autoTagDataWithLocalOnly","getAutoTagInfo","localOnly","listLocalOnly","hasWithoutVersion","laneCompIds","toComponentIds","graphIds","getGraphIds","dependentsMap","reduce","acc","dependents","predecessors","dependentsCompIds","d","attr","dependentsCompIdsFromTheLane","s","allDependentsIds","uniqFromArray","flat","allDependents","getManyConsumerComponents","dependent","triggeredByIds","triggeredBy","fromStringArray","releaseType","incrementBy","exactVersion","isPreReleaseLike","includes","Promise","all","componentToTag","isAutoTag","sources","findOrAddComponent","nextVersion","getNewVersion","toStringWithoutVersion","versionToTag","exactVersionOrReleaseType","getValidVersionOrReleaseType","getVersionToAdd","prereleaseId","preRelease","versionByEnteredId","getVersionByEnteredId","newVersion","setNewVersion","schema","CURRENT_SCHEMA","sha1","v4","enteredIds","enteredId","searchWithoutVersion","buildStatus","isRemoved","Skipped","extensions","clone","existingBuilder","findCoreExtension","Extensions","getNewDependencyVersion","foundDependency","changeVersion","changeExtensionsVersion","ext","extensionId","newDepId","updateDepsResolverData","componentRangePrefix","entry","DependencyResolverAspect","dependencies","get","dep","__type","COMPONENT_DEP_TYPE","depId","ComponentID","fromObject","serialize","isSnapVersion","versionRange","oneComponentToTag","calcComponentRangePrefixByConsumerComponent","getAllDependencies","dependency","autoTagComps","messagePerComponent","copyLogFromPreviousSnap","basicLog","getBasicLog","getLog","msgFromEditor","item","currentLog","log","date","username","email","autoTagComp","defaultMsg","exports","newestVersionsP","componentFromModel","getModelComponentIfExist","BitError","listVersions","latest","getHeadRegardlessOfLaneAsTagOrHash","currentVersion","latestVersion","newestVersions","newestVersionsWithoutEmpty","compact","NewerVersionFound","_addIntegritiesToDependenciesGraph","addIntegritiesToDependenciesGraph","bind","dependenciesGraph","resolvedVersions","selector","integrity","previouslyUsedVersion","entries","index","indexOf","name","substring","pendingPkg","packages","resolution","replacePendingVersions","comps","removedComps","compBitIdsToRemove","deleteComponentsFiles","cleanFromBitMap","configMergeFile","getConflictMergeFile","compId","isNowSnapped","removeConflict","currentlyUnmerged","hasConflict","delete","isAvailableOnMain","isDefault","hasHead","versionToSetInBitmap","isTag","idLatest","toBitIdWithLatestVersionAllowNull","isOnBitmap","bitMap","getComponentIfExist","ignoreVersion","stagedData","getPerId","config","RemoveAspect","addFromComponentJson","componentMapObject","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","compMapObj","toPlainObject","addComponentConfig","removeConfig","hash","getRef","addSnap","getConfigPerId","clearNextVersion","graph","replaceAll","updatedDependenciesGraph","DependenciesGraph","deserialize","versionObj","getBitObjectVersionById","hidden","addModifiedLog"],"sources":["version-maker.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { compact, get } from 'lodash';\nimport { ReleaseType } from 'semver';\nimport { v4 } from 'uuid';\nimport { BitError } from '@teambit/bit-error';\nimport { Scope } from '@teambit/legacy.scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BuildStatus, Extensions } from '@teambit/legacy.constants';\nimport { ConsumerComponent, CURRENT_SCHEMA } from '@teambit/legacy.consumer-component';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport { Consumer, NewerVersionFound } from '@teambit/legacy.consumer';\nimport { Component } from '@teambit/component';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport { getValidVersionOrReleaseType } from '@teambit/pkg.modules.semver-helper';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { isSnap as isSnapVersion } from '@teambit/component-version';\nimport { BuilderMain, OnTagOpts } from '@teambit/builder';\nimport { ModelComponent, Log, DependenciesGraph, Lane } from '@teambit/objects';\nimport { MessagePerComponent, MessagePerComponentFetcher } from './message-per-component';\nimport {\n DependencyResolverAspect,\n DependencyResolverMain,\n COMPONENT_DEP_TYPE,\n ComponentRangePrefix,\n} from '@teambit/dependency-resolver';\nimport { ScopeMain, StagedConfig } from '@teambit/scope';\nimport { Workspace, AutoTagResult } from '@teambit/workspace';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { PackageIntegritiesByPublishedPackages, SnappingMain, TagDataPerComp } from './snapping.main.runtime';\nimport { LaneId } from '@teambit/lane-id';\nimport { DETACH_HEAD, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\n\nexport type BasicTagSnapParams = {\n message: string;\n skipTests?: boolean;\n skipTasks?: string;\n build?: boolean;\n ignoreBuildErrors?: boolean;\n rebuildDepsGraph?: boolean;\n detachHead?: boolean;\n overrideHead?: boolean;\n};\n\nexport type BasicTagParams = BasicTagSnapParams & {\n ignoreNewestVersion?: boolean;\n skipAutoTag?: boolean;\n soft?: boolean;\n persist: boolean;\n disableTagAndSnapPipelines?: boolean;\n preReleaseId?: string;\n editor?: string;\n unmodified?: boolean;\n};\n\nexport type VersionMakerParams = {\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n populateArtifactsIgnorePkgJson?: boolean;\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n exitOnFirstFailedTask?: boolean;\n updateDependentsOnLane?: boolean;\n setHeadAsParent?: boolean;\n} & BasicTagParams;\n\n/**\n * create a tag or a snap of the given components and save them in the local scope.\n */\nexport class VersionMaker {\n private workspace?: Workspace;\n private consumer?: Consumer;\n private legacyScope: Scope;\n private scope: ScopeMain;\n private builder: BuilderMain;\n private dependencyResolver: DependencyResolverMain;\n private allComponentsToTag: ConsumerComponent[] = [];\n private allWorkspaceComps?: Component[];\n constructor(\n private snapping: SnappingMain,\n private components: Component[],\n private consumerComponents: ConsumerComponent[],\n private ids: ComponentIdList,\n private params: VersionMakerParams\n ) {\n this.workspace = snapping.workspace;\n this.scope = snapping.scope;\n this.builder = snapping.builder;\n this.dependencyResolver = snapping.dependencyResolver;\n\n this.consumer = this.workspace?.consumer;\n this.legacyScope = this.scope.legacyScope;\n }\n\n async makeVersion(): Promise<{\n taggedComponents: ConsumerComponent[];\n autoTaggedResults: AutoTagResult[];\n publishedPackages: string[];\n stagedConfig?: StagedConfig;\n removedComponents?: ComponentIdList;\n }> {\n this.allWorkspaceComps = this.workspace ? await this.workspace.list() : undefined;\n const componentsToTag = this.getUniqCompsToTag();\n const idsToTag = ComponentIdList.fromArray(componentsToTag.map((c) => c.id));\n const autoTagData = await this.getAutoTagData(idsToTag);\n const autoTagComponents = autoTagData.map((autoTagItem) => autoTagItem.component);\n const autoTagComponentsFiltered = autoTagComponents.filter((c) => !idsToTag.has(c.id));\n const autoTagIds = ComponentIdList.fromArray(autoTagComponentsFiltered.map((autoTag) => autoTag.id));\n await this.triggerOnPreSnap(autoTagIds);\n this.allComponentsToTag = [...componentsToTag, ...autoTagComponentsFiltered];\n const messagePerId = await this.getMessagePerId(idsToTag, autoTagIds);\n await this.checkForNewerVersions();\n this.setCurrentSchema();\n // go through all components and find the future versions for them\n this.params.isSnap ? this.setHashes() : await this.setFutureVersions(autoTagIds);\n // go through all dependencies and update their versions\n this.updateDependenciesVersions();\n await this.addLogToComponents(componentsToTag, autoTagComponents, messagePerId);\n // don't move it down. otherwise, it'll be empty and we don't know which components were during merge.\n // (it's being deleted in snapping.main.runtime - `_addCompToObjects` method)\n const unmergedComps = (await this.workspace?.listComponentsDuringMerge()) || [];\n const lane = await this.legacyScope.getCurrentLaneObject();\n const stagedConfig = (await this.workspace?.scope.getStagedConfig()) || undefined;\n if (this.params.soft) {\n if (!this.consumer) throw new Error(`unable to soft-tag without consumer`);\n this.consumer.updateNextVersionOnBitmap(this.allComponentsToTag, this.params.preReleaseId);\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages: [],\n stagedConfig,\n };\n }\n\n const { rebuildDepsGraph, build, updateDependentsOnLane, setHeadAsParent, detachHead, overrideHead } = this.params;\n await this.snapping._addFlattenedDependenciesToComponents(this.allComponentsToTag, rebuildDepsGraph);\n await this._addDependenciesGraphToComponents();\n await this.snapping.throwForDepsFromAnotherLane(this.allComponentsToTag);\n if (!build) this.emptyBuilderData();\n this.addBuildStatus(this.allComponentsToTag, BuildStatus.Pending);\n\n const currentLane = this.consumer?.getCurrentLaneId();\n await mapSeries(this.allComponentsToTag, async (component) => {\n const results = await this.snapping._addCompToObjects({\n source: component,\n lane,\n shouldValidateVersion: Boolean(build),\n addVersionOpts: {\n addToUpdateDependentsInLane: updateDependentsOnLane,\n setHeadAsParent,\n detachHead,\n overrideHead: overrideHead,\n },\n });\n if (this.workspace) {\n const modelComponent = component.modelComponent || (await this.legacyScope.getModelComponent(component.id));\n await updateVersions(\n this.workspace,\n stagedConfig!,\n currentLane!,\n modelComponent,\n results.addedVersionStr,\n true\n );\n } else {\n const tagData = this.params.tagDataPerComp?.find((t) => t.componentId.isEqualWithoutVersion(component.id));\n if (tagData?.isNew) results.version.removeAllParents();\n }\n });\n\n if (this.workspace) {\n await this.workspace.scope.legacyScope.stagedSnaps.write();\n }\n const publishedPackages: string[] = [];\n const harmonyCompsToTag = await (this.workspace || this.scope).getManyByLegacy(this.allComponentsToTag);\n // this is not necessarily the same as the previous allComponentsToTag. although it should be, because\n // harmonyCompsToTag is created from allComponentsToTag. however, for aspects, the getMany returns them from cache\n // and therefore, their instance of ConsumerComponent can be different than the one in allComponentsToTag.\n this.allComponentsToTag = harmonyCompsToTag.map((c) => c.state._consumer);\n await this.build(harmonyCompsToTag, publishedPackages);\n\n const removedComponents = await removeDeletedComponentsFromBitmap(this.allComponentsToTag, this.workspace);\n await this.addLaneObject(lane);\n await this.legacyScope.objects.persist();\n await removeMergeConfigFromComponents(unmergedComps, this.allComponentsToTag, this.workspace);\n if (this.workspace) {\n await linkToNodeModulesByComponents(harmonyCompsToTag, this.workspace);\n }\n // clear all objects. otherwise, ModelComponent has the wrong divergeData\n this.legacyScope.objects.clearObjectsFromCache();\n\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages,\n stagedConfig,\n removedComponents,\n };\n }\n\n private async _addDependenciesGraphToComponents(): Promise<void> {\n if (!this.workspace || !this.allWorkspaceComps) {\n return;\n }\n this.snapping.logger.setStatusLine('adding dependencies graph...');\n this.snapping.logger.profile('snap._addDependenciesGraphToComponents');\n const componentIdByPkgName = this._getComponentIdByPkgNameMap();\n const options = {\n rootDir: this.workspace.path,\n rootComponentsPath: this.workspace.rootComponentsPath,\n componentIdByPkgName,\n };\n await pMapPool(\n this.allComponentsToTag,\n async (consumerComponent) => {\n const component = this._findWorkspaceCompByConsumerComp(consumerComponent);\n if (consumerComponent.componentMap?.rootDir && component) {\n await this.dependencyResolver.addDependenciesGraph(\n component,\n consumerComponent.componentMap.rootDir,\n options\n );\n }\n },\n { concurrency: 10 }\n );\n this.snapping.logger.clearStatusLine();\n this.snapping.logger.profile('snap._addDependenciesGraphToComponents');\n }\n\n private _findWorkspaceCompByConsumerComp(consumerComponent: ConsumerComponent): Component | undefined {\n return this.allWorkspaceComps?.find((component) => component.id.isEqualWithoutVersion(consumerComponent.id));\n }\n\n private _getComponentIdByPkgNameMap(): Map<string, ComponentID> {\n if (!this.allWorkspaceComps) throw new Error('please make sure to populate this.allWorkspaceComps before');\n const componentIdByPkgName = new Map<string, ComponentID>();\n this.allComponentsToTag.forEach((consumerComponent) => {\n const component = this._findWorkspaceCompByConsumerComp(consumerComponent);\n if (component) {\n const pkgName = this.dependencyResolver.getPackageName(component);\n componentIdByPkgName.set(pkgName, consumerComponent.id);\n }\n });\n for (const workspaceComp of this.allWorkspaceComps) {\n if (\n this.allComponentsToTag.every(\n (snappedComponent) => !snappedComponent.id.isEqualWithoutVersion(workspaceComp.id)\n )\n ) {\n componentIdByPkgName.set(this.dependencyResolver.getPackageName(workspaceComp), workspaceComp.id);\n }\n }\n return componentIdByPkgName;\n }\n\n private async triggerOnPreSnap(autoTagIds: ComponentIdList) {\n const allFunctions = this.snapping.onPreSnapSlot.values();\n await mapSeries(allFunctions, (func) => func(this.components, autoTagIds, this.params));\n }\n\n private async addLaneObject(lane?: Lane) {\n if (lane) {\n const { message } = this.params;\n const msgStr = message ? ` (${message})` : '';\n const laneHistory = await this.legacyScope.lanes.updateLaneHistory(lane, `snap${msgStr}`);\n this.legacyScope.objects.add(laneHistory);\n }\n }\n\n private async build(harmonyCompsToTag: Component[], publishedPackages: string[]) {\n if (!this.params.build) {\n return;\n }\n const {\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n skipTasks,\n packageManagerConfigRootDir,\n exitOnFirstFailedTask,\n populateArtifactsIgnorePkgJson,\n skipTests,\n } = this.params;\n const onTagOpts: OnTagOpts = {\n disableTagAndSnapPipelines,\n throwOnError: true,\n forceDeploy: ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n };\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n const seedersOnly = !this.workspace; // if tag from scope, build only the given components\n const isolateOptions = { packageManagerConfigRootDir, seedersOnly, populateArtifactsIgnorePkgJson };\n const builderOptions = { exitOnFirstFailedTask, skipTests, skipTasks: skipTasksParsed };\n\n const componentsToBuild = harmonyCompsToTag.filter((c) => !c.isDeleted());\n if (componentsToBuild.length) {\n const componentsToBuildLegacy: ConsumerComponent[] = componentsToBuild.map((c) => c.state._consumer);\n await this.scope.reloadAspectsWithNewVersion(componentsToBuildLegacy);\n const { builderDataMap } = await this.builder.tagListener(\n componentsToBuild,\n onTagOpts,\n isolateOptions,\n builderOptions\n );\n const buildResult = this.scope.builderDataMapToLegacyOnTagResults(builderDataMap);\n\n this.snapping._updateComponentsByTagResult(componentsToBuildLegacy, buildResult);\n const packageIntegritiesByPublishedPackages = this.snapping._getPublishedPackages(componentsToBuildLegacy);\n publishedPackages.push(...Array.from(packageIntegritiesByPublishedPackages.keys()));\n\n addIntegritiesToConsumerComponentsGraphs(packageIntegritiesByPublishedPackages, this.allComponentsToTag);\n this.addBuildStatus(componentsToBuildLegacy, BuildStatus.Succeed);\n await mapSeries(componentsToBuild, (comp) => this.snapping.enrichComp(comp));\n if (populateArtifactsFrom) await updateHiddenProp(this.scope, populateArtifactsFrom);\n }\n }\n\n private async checkForNewerVersions() {\n // check for each one of the components whether it is using an old version\n // TODO: once --detach-head is supported by the remote, deprecate --ignore-newest-version. and change this\n // throwForNewestVersion to suggest using --detach-head instead. also, it the error should not be limited\n // to tags and can be thrown for snaps as well.\n // once --ignore-newest-version is removed, no need for this condition. it's ok to not provide the override-head option.\n const { detachHead, ignoreNewestVersion, isSnap } = this.params;\n if (detachHead && !isFeatureEnabled(DETACH_HEAD)) {\n throw new Error('unable to detach head, the feature is not enabled');\n }\n if (ignoreNewestVersion && !detachHead) this.params.overrideHead = true;\n if (!ignoreNewestVersion && !isSnap) {\n await throwForNewestVersion(this.allComponentsToTag, this.legacyScope);\n }\n }\n\n private async getMessagePerId(idsToTag: ComponentIdList, autoTagIds: ComponentIdList) {\n const messagesFromEditorFetcher = new MessagePerComponentFetcher(idsToTag, autoTagIds);\n const { editor, message, tagDataPerComp } = this.params;\n if (editor) return messagesFromEditorFetcher.getMessagesFromEditor(this.legacyScope.tmp, editor);\n if (tagDataPerComp) return tagDataPerComp.map((t) => ({ id: t.componentId, msg: t.message || message }));\n return [];\n }\n\n private getUniqCompsToTag(): ConsumerComponent[] {\n const consumerComponentsIdsMap = {};\n // Concat and unique all the dependencies from all the components so we will not import\n // the same dependency more then once, it's mainly for performance purpose\n this.consumerComponents.forEach((consumerComponent) => {\n const componentIdString = consumerComponent.id.toString();\n // Store it in a map so we can take it easily from the sorted array which contain only the id\n consumerComponentsIdsMap[componentIdString] = consumerComponent;\n });\n return Object.values(consumerComponentsIdsMap); // consumerComponents unique\n }\n\n private async getAutoTagData(idsToTag: ComponentIdList): Promise<AutoTagResult[]> {\n if (this.params.skipAutoTag) return [];\n if (!this.workspace) return this.getLaneAutoTagIdsFromScope(idsToTag);\n // ids without versions are new. it's impossible that tagged (and not-modified) components has\n // them as dependencies.\n const idsToTriggerAutoTag = idsToTag.filter((id) => id.hasVersion());\n const autoTagDataWithLocalOnly = await this.workspace.getAutoTagInfo(\n ComponentIdList.fromArray(idsToTriggerAutoTag)\n );\n const localOnly = this.workspace?.listLocalOnly();\n return localOnly\n ? autoTagDataWithLocalOnly.filter((autoTagItem) => !localOnly.hasWithoutVersion(autoTagItem.component.id))\n : autoTagDataWithLocalOnly;\n }\n\n private async getLaneAutoTagIdsFromScope(idsToTag: ComponentIdList): Promise<AutoTagResult[]> {\n const lane = await this.legacyScope.getCurrentLaneObject();\n if (!lane) return [];\n const laneCompIds = lane.toComponentIds();\n const graphIds = await this.scope.getGraphIds(laneCompIds);\n const dependentsMap = idsToTag.reduce(\n (acc, id) => {\n const dependents = graphIds.predecessors(id.toString());\n const dependentsCompIds = dependents.map((d) => d.attr);\n const dependentsCompIdsFromTheLane = dependentsCompIds.filter((s) => laneCompIds.has(s));\n if (!dependentsCompIdsFromTheLane.length) return acc;\n acc[id.toString()] = ComponentIdList.fromArray(dependentsCompIdsFromTheLane);\n return acc;\n },\n {} as Record<string, ComponentIdList>\n );\n if (Object.keys(dependentsMap).length === 0) return [];\n const allDependentsIds = ComponentIdList.uniqFromArray(Object.values(dependentsMap).flat());\n const allDependents = await this.legacyScope.getManyConsumerComponents(allDependentsIds);\n return allDependents.map((dependent) => {\n const triggeredByIds = Object.keys(dependentsMap).filter((id) => dependentsMap[id].has(dependent.id));\n const triggeredBy = ComponentIdList.fromStringArray(triggeredByIds);\n return { component: dependent, triggeredBy };\n });\n }\n\n private async setFutureVersions(autoTagIds: ComponentIdList): Promise<void> {\n const { releaseType, tagDataPerComp, incrementBy, persist, soft, exactVersion, preReleaseId } = this.params;\n const isPreReleaseLike = releaseType\n ? ['prerelease', 'premajor', 'preminor', 'prepatch'].includes(releaseType)\n : false;\n await Promise.all(\n this.allComponentsToTag.map(async (componentToTag) => {\n const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);\n const modelComponent = await this.legacyScope.sources.findOrAddComponent(componentToTag);\n const nextVersion = componentToTag.componentMap?.nextVersion?.version;\n const getNewVersion = (): string => {\n if (tagDataPerComp) {\n const tagData = tagDataPerComp.find((t) => t.componentId.isEqualWithoutVersion(componentToTag.id));\n if (!tagData) throw new Error(`tag-data is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n if (!tagData.versionToTag)\n throw new Error(`tag-data.TagResults is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(tagData.versionToTag);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n incrementBy,\n tagData.prereleaseId\n );\n }\n if (nextVersion && persist) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(nextVersion);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n undefined,\n componentToTag.componentMap?.nextVersion?.preRelease\n );\n }\n if (isAutoTag) {\n // auto-tag always bumped as patch unless it's pre-release\n if (isPreReleaseLike) {\n return soft\n ? (releaseType as string)\n : modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n }\n return soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);\n }\n const versionByEnteredId = this.getVersionByEnteredId(this.ids, componentToTag, modelComponent);\n return soft\n ? versionByEnteredId || exactVersion || (releaseType as string)\n : versionByEnteredId ||\n modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n };\n const newVersion = getNewVersion();\n componentToTag.setNewVersion(newVersion);\n })\n );\n }\n\n private setCurrentSchema() {\n this.allComponentsToTag.forEach((component) => {\n component.schema = CURRENT_SCHEMA;\n });\n }\n\n private setHashes(): void {\n this.allComponentsToTag.forEach((componentToTag) => {\n componentToTag.setNewVersion(sha1(v4()));\n });\n }\n\n private getVersionByEnteredId(\n enteredIds: ComponentIdList,\n component: ConsumerComponent,\n modelComponent: ModelComponent\n ): string | undefined {\n const enteredId = enteredIds.searchWithoutVersion(component.id);\n if (enteredId && enteredId.hasVersion()) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(enteredId.version as string);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion\n );\n }\n return undefined;\n }\n\n private addBuildStatus(components: ConsumerComponent[], buildStatus: BuildStatus) {\n components.forEach((component) => {\n component.buildStatus = component.isRemoved() ? BuildStatus.Skipped : buildStatus;\n });\n }\n\n /**\n * otherwise, tagging without build will have the old build data of the previous snap/tag.\n * in case we currently build, it's ok to leave the data as is, because it'll be overridden anyway.\n */\n private emptyBuilderData() {\n this.allComponentsToTag.forEach((component) => {\n component.extensions = component.extensions.clone();\n const existingBuilder = component.extensions.findCoreExtension(Extensions.builder);\n if (existingBuilder) existingBuilder.data = {};\n });\n }\n\n private updateDependenciesVersions() {\n // filter out removed components.\n // if a component has a deleted-component as a dependency, it was probably running \"bit install <dep>\" with a version\n // from main. we want to keep it as the user requested. Otherwise, this changes the dependency version to the newly\n // snapped one unintentionally.\n const componentsToTag = this.allComponentsToTag.filter((c) => !c.isRemoved());\n const getNewDependencyVersion = (id: ComponentID): ComponentID | null => {\n const foundDependency = componentsToTag.find((component) => component.id.isEqualWithoutVersion(id));\n return foundDependency ? id.changeVersion(foundDependency.version) : null;\n };\n const changeExtensionsVersion = (component: ConsumerComponent): void => {\n component.extensions.forEach((ext) => {\n if (ext.extensionId) {\n const newDepId = getNewDependencyVersion(ext.extensionId);\n if (newDepId) ext.extensionId = newDepId;\n }\n });\n };\n // in case we update dependencies according to the currently tagged component, we want to keep the versionRange\n // up to date with the new tags. e.g. 0.0.1 -> 0.0.2, will change the versionRange to ^0.0.2 or ~0.0.2.\n // in case componentRangePrefix is \"+\", we care only about packages in workspace.jsonc. so it won't be relevant.\n const updateDepsResolverData = (component: ConsumerComponent, componentRangePrefix?: ComponentRangePrefix) => {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return component;\n }\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type !== COMPONENT_DEP_TYPE) {\n return;\n }\n // @todo: it's unclear why \"dep.componentId\" randomly becomes a ComponentID instance.\n // this check is added because on Ripple in some scenarios it was throwing:\n // \"ComponentID.fromObject expect to get an object, got an instance of ComponentID\" (locally it didn't happen)\n const depId =\n dep.componentId instanceof ComponentID ? dep.componentId : ComponentID.fromObject(dep.componentId);\n const newDepId = getNewDependencyVersion(depId);\n dep.componentId = (newDepId || depId).serialize();\n dep.id = (newDepId || depId).toString();\n dep.version = (newDepId || depId).version;\n // if newDepId, then it means the dependency is in the current workspace and currently being tagged.\n // the versionRange needs to be updated to the new version.\n // However, for snaps, we should not apply range prefixes as they are not valid semver\n if (newDepId && (componentRangePrefix === '^' || componentRangePrefix === '~') && !isSnapVersion(dep.version)) {\n dep.versionRange = `${componentRangePrefix}${dep.version}`;\n }\n });\n return component;\n };\n\n componentsToTag.forEach((oneComponentToTag) => {\n const componentRangePrefix =\n this.dependencyResolver.calcComponentRangePrefixByConsumerComponent(oneComponentToTag);\n oneComponentToTag.getAllDependencies().forEach((dependency) => {\n const newDepId = getNewDependencyVersion(dependency.id);\n if (!newDepId) return;\n dependency.id = newDepId;\n // if componentRangePrefix === '+', then, only it only saves packages in workspace.jsonc.\n // in this case, these dependencies are in .bitmap. not in workspace.jsonc. so it's not relevant.\n // For snaps (hash versions), we should not apply range prefixes as they are not valid semver\n if ((componentRangePrefix === '^' || componentRangePrefix === '~') && !isSnapVersion(newDepId.version)) {\n dependency.versionRange = `${componentRangePrefix}${newDepId.version}`;\n }\n });\n changeExtensionsVersion(oneComponentToTag);\n oneComponentToTag = updateDepsResolverData(oneComponentToTag);\n });\n }\n\n private async addLogToComponents(\n components: ConsumerComponent[],\n autoTagComps: ConsumerComponent[],\n messagePerComponent: MessagePerComponent[]\n ) {\n let { message } = this.params;\n const { persist, copyLogFromPreviousSnap } = this.params;\n // @ts-ignore this happens when running `bit tag -m \"\"`.\n if (message === true) {\n message = '';\n }\n const basicLog = await getBasicLog();\n const getLog = (component: ConsumerComponent): Log => {\n const nextVersion = persist ? component.componentMap?.nextVersion : null;\n const msgFromEditor = messagePerComponent.find((item) => item.id.isEqualWithoutVersion(component.id))?.msg;\n if (copyLogFromPreviousSnap) {\n const currentLog = component.log;\n if (!currentLog) {\n throw new Error(\n `addLogToComponents is set copyLogFromPreviousSnap: true, but it is unable to find log in the previous snap`\n );\n }\n currentLog.message = msgFromEditor || message || currentLog.message;\n currentLog.date = basicLog.date;\n return currentLog;\n }\n\n return {\n username: nextVersion?.username || basicLog.username,\n email: nextVersion?.email || basicLog.email,\n message: nextVersion?.message || msgFromEditor || message,\n date: basicLog.date,\n };\n };\n\n components.forEach((component) => {\n component.log = getLog(component);\n });\n autoTagComps.forEach((autoTagComp) => {\n autoTagComp.log = getLog(autoTagComp);\n const defaultMsg = 'bump dependencies versions';\n if (message) {\n autoTagComp.log.message += ` (${defaultMsg})`;\n } else if (!autoTagComp.log.message) {\n autoTagComp.log.message = defaultMsg;\n }\n });\n }\n}\n\nasync function throwForNewestVersion(allComponentsToTag: ConsumerComponent[], legacyScope: Scope) {\n const newestVersionsP = allComponentsToTag.map(async (component) => {\n if (component.componentFromModel) {\n // otherwise it's a new component, so this check is irrelevant\n const modelComponent = await legacyScope.getModelComponentIfExist(component.id);\n if (!modelComponent) throw new BitError(`component ${component.id} was not found in the model`);\n if (!modelComponent.listVersions().length) return null; // no versions yet, no issues.\n const latest = modelComponent.getHeadRegardlessOfLaneAsTagOrHash();\n if (latest !== component.version) {\n return {\n componentId: component.id.toStringWithoutVersion(),\n currentVersion: component.version!,\n latestVersion: latest,\n };\n }\n }\n return null;\n });\n const newestVersions = await Promise.all(newestVersionsP);\n const newestVersionsWithoutEmpty = compact(newestVersions);\n if (newestVersionsWithoutEmpty.length) {\n throw new NewerVersionFound(newestVersionsWithoutEmpty);\n }\n}\n\nfunction addIntegritiesToConsumerComponentsGraphs(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n consumerComponents: ConsumerComponent[]\n) {\n const _addIntegritiesToDependenciesGraph = addIntegritiesToDependenciesGraph.bind(\n null,\n packageIntegritiesByPublishedPackages\n );\n for (const consumerComponent of consumerComponents) {\n if (consumerComponent.dependenciesGraph) {\n consumerComponent.dependenciesGraph = _addIntegritiesToDependenciesGraph(consumerComponent.dependenciesGraph);\n }\n }\n}\n\n/**\n * Updates the dependencies graph by replacing all \"pending\" version numbers of component dependencies\n * with the actual version numbers of the recently published packages. It also attaches the integrity\n * checksums of these components to ensure data integrity for each resolved dependency.\n *\n * @param packageIntegritiesByPublishedPackages - A map of package names and versions to their integrity checksums.\n * @param dependenciesGraph - The current dependencies graph, containing nodes with potentially \"pending\" versions.\n * @returns A new DependenciesGraph with updated versions and integrity checksums for all previously pending dependencies.\n */\nfunction addIntegritiesToDependenciesGraph(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n dependenciesGraph: DependenciesGraph\n): DependenciesGraph {\n const resolvedVersions: Array<{ name: string; version: string; previouslyUsedVersion?: string }> = [];\n for (const [selector, { integrity, previouslyUsedVersion }] of packageIntegritiesByPublishedPackages.entries()) {\n if (integrity == null) continue;\n const index = selector.indexOf('@', 1);\n const name = selector.substring(0, index);\n const version = selector.substring(index + 1);\n const pendingPkg =\n dependenciesGraph.packages.get(`${name}@${previouslyUsedVersion}`) ??\n dependenciesGraph.packages.get(`${name}@${version}`);\n if (pendingPkg) {\n pendingPkg.resolution = { integrity };\n resolvedVersions.push({ name, version, previouslyUsedVersion });\n }\n }\n return replacePendingVersions(dependenciesGraph, resolvedVersions) as DependenciesGraph;\n}\n\nasync function removeDeletedComponentsFromBitmap(\n comps: ConsumerComponent[],\n workspace?: Workspace\n): Promise<ComponentIdList | undefined> {\n if (!workspace) {\n return undefined;\n }\n const removedComps = comps.filter((comp) => comp.isRemoved());\n if (!removedComps.length) return undefined;\n const compBitIdsToRemove = ComponentIdList.fromArray(removedComps.map((c) => c.id));\n await deleteComponentsFiles(workspace.consumer, compBitIdsToRemove);\n await workspace.consumer.cleanFromBitMap(compBitIdsToRemove);\n\n return compBitIdsToRemove;\n}\n\nasync function removeMergeConfigFromComponents(\n unmergedComps: ComponentID[],\n components: ConsumerComponent[],\n workspace?: Workspace\n) {\n if (!workspace || !unmergedComps.length) {\n return;\n }\n const configMergeFile = workspace.getConflictMergeFile();\n\n unmergedComps.forEach((compId) => {\n const isNowSnapped = components.find((c) => c.id.isEqualWithoutVersion(compId));\n if (isNowSnapped) {\n configMergeFile.removeConflict(compId.toStringWithoutVersion());\n }\n });\n const currentlyUnmerged = workspace ? await workspace.listComponentsDuringMerge() : [];\n if (configMergeFile.hasConflict() && currentlyUnmerged.length) {\n // it's possible that \"workspace\" section is still there. but if all \"unmerged\" are now merged,\n // then, it's safe to delete the file.\n await configMergeFile.write();\n } else {\n await configMergeFile.delete();\n }\n}\n\nexport type BitCloudUser = {\n username?: string;\n name?: string;\n displayName?: string;\n profileImage?: string;\n};\n\nfunction isAvailableOnMain(currentLane: LaneId, modelComponent: ModelComponent, id: ComponentID) {\n if (currentLane.isDefault()) {\n return true;\n }\n if (!id.hasVersion()) {\n // component was unsnapped on the current lane and is back to a new component\n return true;\n }\n return modelComponent.hasHead();\n}\n\nexport async function updateVersions(\n workspace: Workspace,\n stagedConfig: StagedConfig,\n currentLane: LaneId,\n modelComponent: ModelComponent,\n versionToSetInBitmap?: string, // helpful for detached head\n isTag = true\n) {\n const consumer = workspace.consumer;\n const idLatest: ComponentID = modelComponent.toBitIdWithLatestVersionAllowNull();\n const id = versionToSetInBitmap ? idLatest.changeVersion(versionToSetInBitmap) : idLatest;\n const isOnBitmap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion: true });\n if (!isOnBitmap && !isTag) {\n // handle the case when a component was deleted, snapped/tagged and is now reset.\n const stagedData = stagedConfig.getPerId(id);\n if (stagedData?.config && stagedData.config[RemoveAspect.id]) {\n consumer.bitMap.addFromComponentJson(stagedData.id, stagedData.componentMapObject);\n }\n }\n consumer.bitMap.updateComponentId(id, undefined, undefined, true);\n const availableOnMain = isAvailableOnMain(currentLane, modelComponent, id);\n if (!availableOnMain) {\n consumer.bitMap.setOnLanesOnly(id, true);\n }\n const componentMap = consumer.bitMap.getComponent(id);\n const compId = await workspace.resolveComponentId(id);\n // it can be either a tag/snap or reset.\n if (isTag) {\n const compMapObj = componentMap.toPlainObject();\n const config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config, compMapObj);\n consumer.bitMap.removeConfig(id);\n const hash = modelComponent.getRef(id.version as string);\n if (!hash) throw new Error(`updateComponentsVersions: unable to find a hash for ${id.toString()}`);\n workspace.scope.legacyScope.stagedSnaps.addSnap(hash?.toString());\n } else if (!componentMap.config) {\n componentMap.config = stagedConfig.getConfigPerId(compId);\n }\n componentMap.clearNextVersion();\n}\n\nfunction replacePendingVersions(\n graph: DependenciesGraph,\n resolvedVersions: Array<{ name: string; version: string; previouslyUsedVersion?: string }>\n): DependenciesGraph {\n let s = graph.serialize();\n for (const { name, version, previouslyUsedVersion } of resolvedVersions) {\n if (previouslyUsedVersion) {\n s = s.replaceAll(`${name}@${previouslyUsedVersion}:`, `${name}@${version}`);\n }\n }\n const updatedDependenciesGraph = DependenciesGraph.deserialize(s);\n // This should never happen as we know at this point that the schema version is supported\n if (updatedDependenciesGraph == null) {\n throw new BitError('Failed to deserialize dependencies graph in replacePendingVersions()');\n }\n return updatedDependenciesGraph;\n}\n\n/**\n * relevant for \"_tag\" (tag-from-scope) command.\n * the new tag uses the same files/config/build-artifacts as the previous snap.\n * we want to mark the previous snap as hidden. so then \"bit log\" and \"bit blame\" won't show it.\n */\nasync function updateHiddenProp(scope: ScopeMain, ids: ComponentID[]) {\n const log = await getBasicLog();\n log.message = 'marked as hidden';\n await pMapPool(\n ids,\n async (id) => {\n const versionObj = await scope.getBitObjectVersionById(id);\n if (!versionObj) return;\n versionObj.hidden = true;\n versionObj.addModifiedLog(log);\n scope.legacyScope.objects.add(versionObj);\n },\n { concurrency: 50 }\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AA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,IAAK;IACZ,MAAMyW,UAAU,GAAG,MAAMzX,KAAK,CAAC0X,uBAAuB,CAAC1W,EAAE,CAAC;IAC1D,IAAI,CAACyW,UAAU,EAAE;IACjBA,UAAU,CAACE,MAAM,GAAG,IAAI;IACxBF,UAAU,CAACG,cAAc,CAACzF,GAAG,CAAC;IAC9BnS,KAAK,CAACI,WAAW,CAAC2F,OAAO,CAACsC,GAAG,CAACoP,UAAU,CAAC;EAC3C,CAAC,EACD;IAAEvQ,WAAW,EAAE;EAAG,CACpB,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_lodash","_uuid","_bitError","_componentId","_legacy","_legacy2","_workspaceModules","_legacy3","_remove","_pkgModules","_harmonyModules","_toolboxCrypto","_componentVersion","_objects","_messagePerComponent","_dependencyResolver","_toolboxPromise","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","VersionMaker","constructor","snapping","components","consumerComponents","ids","params","workspace","scope","builder","dependencyResolver","consumer","legacyScope","makeVersion","allWorkspaceComps","list","undefined","componentsToTag","getUniqCompsToTag","idsToTag","ComponentIdList","fromArray","map","c","id","autoTagData","getAutoTagData","autoTagComponents","autoTagItem","component","autoTagComponentsFiltered","filter","has","autoTagIds","autoTag","triggerOnPreSnap","allComponentsToTag","messagePerId","getMessagePerId","checkForNewerVersions","setCurrentSchema","isSnap","setHashes","setFutureVersions","updateDependenciesVersions","addLogToComponents","unmergedComps","listComponentsDuringMerge","lane","getCurrentLaneObject","stagedConfig","getStagedConfig","soft","Error","updateNextVersionOnBitmap","preReleaseId","taggedComponents","autoTaggedResults","publishedPackages","rebuildDepsGraph","build","updateDependentsOnLane","setHeadAsParent","detachHead","overrideHead","_addFlattenedDependenciesToComponents","_addDependenciesGraphToComponents","throwForDepsFromAnotherLane","emptyBuilderData","addBuildStatus","BuildStatus","Pending","currentLane","getCurrentLaneId","mapSeries","results","_addCompToObjects","source","shouldValidateVersion","Boolean","addVersionOpts","addToUpdateDependentsInLane","modelComponent","getModelComponent","updateVersions","addedVersionStr","tagData","tagDataPerComp","find","componentId","isEqualWithoutVersion","isNew","version","removeAllParents","stagedSnaps","write","harmonyCompsToTag","getManyByLegacy","state","_consumer","removedComponents","removeDeletedComponentsFromBitmap","addLaneObject","objects","persist","removeMergeConfigFromComponents","linkToNodeModulesByComponents","clearObjectsFromCache","logger","setStatusLine","profile","componentIdByPkgName","_getComponentIdByPkgNameMap","options","rootDir","path","rootComponentsPath","pMapPool","consumerComponent","_findWorkspaceCompByConsumerComp","componentMap","addDependenciesGraph","concurrency","clearStatusLine","Map","forEach","pkgName","getPackageName","set","workspaceComp","every","snappedComponent","allFunctions","onPreSnapSlot","values","func","message","msgStr","laneHistory","lanes","updateLaneHistory","add","disableTagAndSnapPipelines","ignoreBuildErrors","populateArtifactsFrom","skipTasks","packageManagerConfigRootDir","exitOnFirstFailedTask","populateArtifactsIgnorePkgJson","skipTests","loose","onTagOpts","throwOnError","forceDeploy","skipTasksParsed","split","trim","seedersOnly","isolateOptions","builderOptions","componentsToBuild","isDeleted","length","componentsToBuildLegacy","reloadAspectsWithNewVersion","builderDataMap","tagListener","buildResult","builderDataMapToLegacyOnTagResults","_updateComponentsByTagResult","packageIntegritiesByPublishedPackages","_getPublishedPackages","push","Array","from","keys","addIntegritiesToConsumerComponentsGraphs","Succeed","comp","enrichComp","updateHiddenProp","ignoreNewestVersion","throwForNewestVersion","messagesFromEditorFetcher","MessagePerComponentFetcher","editor","getMessagesFromEditor","tmp","msg","consumerComponentsIdsMap","componentIdString","toString","skipAutoTag","getLaneAutoTagIdsFromScope","idsToTriggerAutoTag","hasVersion","autoTagDataWithLocalOnly","getAutoTagInfo","localOnly","listLocalOnly","hasWithoutVersion","laneCompIds","toComponentIds","graphIds","getGraphIds","dependentsMap","reduce","acc","dependents","predecessors","dependentsCompIds","d","attr","dependentsCompIdsFromTheLane","s","allDependentsIds","uniqFromArray","flat","allDependents","getManyConsumerComponents","dependent","triggeredByIds","triggeredBy","fromStringArray","releaseType","incrementBy","exactVersion","isPreReleaseLike","includes","Promise","all","componentToTag","isAutoTag","sources","findOrAddComponent","nextVersion","getNewVersion","toStringWithoutVersion","versionToTag","exactVersionOrReleaseType","getValidVersionOrReleaseType","getVersionToAdd","prereleaseId","preRelease","versionByEnteredId","getVersionByEnteredId","newVersion","setNewVersion","schema","CURRENT_SCHEMA","sha1","v4","enteredIds","enteredId","searchWithoutVersion","buildStatus","isRemoved","Skipped","extensions","clone","existingBuilder","findCoreExtension","Extensions","getNewDependencyVersion","foundDependency","changeVersion","changeExtensionsVersion","ext","extensionId","newDepId","updateDepsResolverData","componentRangePrefix","entry","DependencyResolverAspect","dependencies","get","dep","__type","COMPONENT_DEP_TYPE","depId","ComponentID","fromObject","serialize","isSnapVersion","versionRange","oneComponentToTag","calcComponentRangePrefixByConsumerComponent","getAllDependencies","dependency","autoTagComps","messagePerComponent","copyLogFromPreviousSnap","basicLog","getBasicLog","getLog","msgFromEditor","item","currentLog","log","date","username","email","autoTagComp","defaultMsg","exports","newestVersionsP","componentFromModel","getModelComponentIfExist","BitError","listVersions","latest","getHeadRegardlessOfLaneAsTagOrHash","currentVersion","latestVersion","newestVersions","newestVersionsWithoutEmpty","compact","NewerVersionFound","_addIntegritiesToDependenciesGraph","addIntegritiesToDependenciesGraph","bind","dependenciesGraph","resolvedVersions","selector","integrity","previouslyUsedVersion","entries","index","indexOf","name","substring","pendingPkg","packages","resolution","replacePendingVersions","comps","removedComps","compBitIdsToRemove","deleteComponentsFiles","cleanFromBitMap","configMergeFile","getConflictMergeFile","compId","isNowSnapped","removeConflict","currentlyUnmerged","hasConflict","delete","isAvailableOnMain","isDefault","hasHead","versionToSetInBitmap","isTag","idLatest","toBitIdWithLatestVersionAllowNull","isOnBitmap","bitMap","getComponentIfExist","ignoreVersion","stagedData","getPerId","config","RemoveAspect","addFromComponentJson","componentMapObject","updateComponentId","availableOnMain","setOnLanesOnly","getComponent","resolveComponentId","compMapObj","toPlainObject","addComponentConfig","removeConfig","hash","getRef","addSnap","getConfigPerId","clearNextVersion","graph","replaceAll","updatedDependenciesGraph","DependenciesGraph","deserialize","versionObj","getBitObjectVersionById","hidden","addModifiedLog"],"sources":["version-maker.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { compact, get } from 'lodash';\nimport { ReleaseType } from 'semver';\nimport { v4 } from 'uuid';\nimport { BitError } from '@teambit/bit-error';\nimport { Scope } from '@teambit/legacy.scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BuildStatus, Extensions } from '@teambit/legacy.constants';\nimport { ConsumerComponent, CURRENT_SCHEMA } from '@teambit/legacy.consumer-component';\nimport { linkToNodeModulesByComponents } from '@teambit/workspace.modules.node-modules-linker';\nimport { Consumer, NewerVersionFound } from '@teambit/legacy.consumer';\nimport { Component } from '@teambit/component';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport { getValidVersionOrReleaseType } from '@teambit/pkg.modules.semver-helper';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { isSnap as isSnapVersion } from '@teambit/component-version';\nimport { BuilderMain, OnTagOpts } from '@teambit/builder';\nimport { ModelComponent, Log, DependenciesGraph, Lane } from '@teambit/objects';\nimport { MessagePerComponent, MessagePerComponentFetcher } from './message-per-component';\nimport {\n DependencyResolverAspect,\n DependencyResolverMain,\n COMPONENT_DEP_TYPE,\n ComponentRangePrefix,\n} from '@teambit/dependency-resolver';\nimport { ScopeMain, StagedConfig } from '@teambit/scope';\nimport { Workspace, AutoTagResult } from '@teambit/workspace';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { PackageIntegritiesByPublishedPackages, SnappingMain, TagDataPerComp } from './snapping.main.runtime';\nimport { LaneId } from '@teambit/lane-id';\n\nexport type BasicTagSnapParams = {\n message: string;\n skipTests?: boolean;\n skipTasks?: string;\n build?: boolean;\n ignoreBuildErrors?: boolean;\n rebuildDepsGraph?: boolean;\n detachHead?: boolean;\n overrideHead?: boolean;\n loose?: boolean;\n};\n\nexport type BasicTagParams = BasicTagSnapParams & {\n ignoreNewestVersion?: boolean;\n skipAutoTag?: boolean;\n soft?: boolean;\n persist: boolean;\n disableTagAndSnapPipelines?: boolean;\n preReleaseId?: string;\n editor?: string;\n unmodified?: boolean;\n};\n\nexport type VersionMakerParams = {\n tagDataPerComp?: TagDataPerComp[];\n populateArtifactsFrom?: ComponentID[];\n populateArtifactsIgnorePkgJson?: boolean;\n copyLogFromPreviousSnap?: boolean;\n exactVersion?: string | null | undefined;\n releaseType?: ReleaseType;\n incrementBy?: number;\n isSnap?: boolean;\n packageManagerConfigRootDir?: string;\n exitOnFirstFailedTask?: boolean;\n updateDependentsOnLane?: boolean;\n setHeadAsParent?: boolean;\n} & BasicTagParams;\n\n/**\n * create a tag or a snap of the given components and save them in the local scope.\n */\nexport class VersionMaker {\n private workspace?: Workspace;\n private consumer?: Consumer;\n private legacyScope: Scope;\n private scope: ScopeMain;\n private builder: BuilderMain;\n private dependencyResolver: DependencyResolverMain;\n private allComponentsToTag: ConsumerComponent[] = [];\n private allWorkspaceComps?: Component[];\n constructor(\n private snapping: SnappingMain,\n private components: Component[],\n private consumerComponents: ConsumerComponent[],\n private ids: ComponentIdList,\n private params: VersionMakerParams\n ) {\n this.workspace = snapping.workspace;\n this.scope = snapping.scope;\n this.builder = snapping.builder;\n this.dependencyResolver = snapping.dependencyResolver;\n\n this.consumer = this.workspace?.consumer;\n this.legacyScope = this.scope.legacyScope;\n }\n\n async makeVersion(): Promise<{\n taggedComponents: ConsumerComponent[];\n autoTaggedResults: AutoTagResult[];\n publishedPackages: string[];\n stagedConfig?: StagedConfig;\n removedComponents?: ComponentIdList;\n }> {\n this.allWorkspaceComps = this.workspace ? await this.workspace.list() : undefined;\n const componentsToTag = this.getUniqCompsToTag();\n const idsToTag = ComponentIdList.fromArray(componentsToTag.map((c) => c.id));\n const autoTagData = await this.getAutoTagData(idsToTag);\n const autoTagComponents = autoTagData.map((autoTagItem) => autoTagItem.component);\n const autoTagComponentsFiltered = autoTagComponents.filter((c) => !idsToTag.has(c.id));\n const autoTagIds = ComponentIdList.fromArray(autoTagComponentsFiltered.map((autoTag) => autoTag.id));\n await this.triggerOnPreSnap(autoTagIds);\n this.allComponentsToTag = [...componentsToTag, ...autoTagComponentsFiltered];\n const messagePerId = await this.getMessagePerId(idsToTag, autoTagIds);\n await this.checkForNewerVersions();\n this.setCurrentSchema();\n // go through all components and find the future versions for them\n this.params.isSnap ? this.setHashes() : await this.setFutureVersions(autoTagIds);\n // go through all dependencies and update their versions\n this.updateDependenciesVersions();\n await this.addLogToComponents(componentsToTag, autoTagComponents, messagePerId);\n // don't move it down. otherwise, it'll be empty and we don't know which components were during merge.\n // (it's being deleted in snapping.main.runtime - `_addCompToObjects` method)\n const unmergedComps = (await this.workspace?.listComponentsDuringMerge()) || [];\n const lane = await this.legacyScope.getCurrentLaneObject();\n const stagedConfig = (await this.workspace?.scope.getStagedConfig()) || undefined;\n if (this.params.soft) {\n if (!this.consumer) throw new Error(`unable to soft-tag without consumer`);\n this.consumer.updateNextVersionOnBitmap(this.allComponentsToTag, this.params.preReleaseId);\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages: [],\n stagedConfig,\n };\n }\n\n const { rebuildDepsGraph, build, updateDependentsOnLane, setHeadAsParent, detachHead, overrideHead } = this.params;\n await this.snapping._addFlattenedDependenciesToComponents(this.allComponentsToTag, rebuildDepsGraph);\n await this._addDependenciesGraphToComponents();\n await this.snapping.throwForDepsFromAnotherLane(this.allComponentsToTag);\n if (!build) this.emptyBuilderData();\n this.addBuildStatus(this.allComponentsToTag, BuildStatus.Pending);\n\n const currentLane = this.consumer?.getCurrentLaneId();\n await mapSeries(this.allComponentsToTag, async (component) => {\n const results = await this.snapping._addCompToObjects({\n source: component,\n lane,\n shouldValidateVersion: Boolean(build),\n addVersionOpts: {\n addToUpdateDependentsInLane: updateDependentsOnLane,\n setHeadAsParent,\n detachHead,\n overrideHead: overrideHead,\n },\n });\n if (this.workspace) {\n const modelComponent = component.modelComponent || (await this.legacyScope.getModelComponent(component.id));\n await updateVersions(\n this.workspace,\n stagedConfig!,\n currentLane!,\n modelComponent,\n results.addedVersionStr,\n true\n );\n } else {\n const tagData = this.params.tagDataPerComp?.find((t) => t.componentId.isEqualWithoutVersion(component.id));\n if (tagData?.isNew) results.version.removeAllParents();\n }\n });\n\n if (this.workspace) {\n await this.workspace.scope.legacyScope.stagedSnaps.write();\n }\n const publishedPackages: string[] = [];\n const harmonyCompsToTag = await (this.workspace || this.scope).getManyByLegacy(this.allComponentsToTag);\n // this is not necessarily the same as the previous allComponentsToTag. although it should be, because\n // harmonyCompsToTag is created from allComponentsToTag. however, for aspects, the getMany returns them from cache\n // and therefore, their instance of ConsumerComponent can be different than the one in allComponentsToTag.\n this.allComponentsToTag = harmonyCompsToTag.map((c) => c.state._consumer);\n await this.build(harmonyCompsToTag, publishedPackages);\n\n const removedComponents = await removeDeletedComponentsFromBitmap(this.allComponentsToTag, this.workspace);\n await this.addLaneObject(lane);\n await this.legacyScope.objects.persist();\n await removeMergeConfigFromComponents(unmergedComps, this.allComponentsToTag, this.workspace);\n if (this.workspace) {\n await linkToNodeModulesByComponents(harmonyCompsToTag, this.workspace);\n }\n // clear all objects. otherwise, ModelComponent has the wrong divergeData\n this.legacyScope.objects.clearObjectsFromCache();\n\n return {\n taggedComponents: componentsToTag,\n autoTaggedResults: autoTagData,\n publishedPackages,\n stagedConfig,\n removedComponents,\n };\n }\n\n private async _addDependenciesGraphToComponents(): Promise<void> {\n if (!this.workspace || !this.allWorkspaceComps) {\n return;\n }\n this.snapping.logger.setStatusLine('adding dependencies graph...');\n this.snapping.logger.profile('snap._addDependenciesGraphToComponents');\n const componentIdByPkgName = this._getComponentIdByPkgNameMap();\n const options = {\n rootDir: this.workspace.path,\n rootComponentsPath: this.workspace.rootComponentsPath,\n componentIdByPkgName,\n };\n await pMapPool(\n this.allComponentsToTag,\n async (consumerComponent) => {\n const component = this._findWorkspaceCompByConsumerComp(consumerComponent);\n if (consumerComponent.componentMap?.rootDir && component) {\n await this.dependencyResolver.addDependenciesGraph(\n component,\n consumerComponent.componentMap.rootDir,\n options\n );\n }\n },\n { concurrency: 10 }\n );\n this.snapping.logger.clearStatusLine();\n this.snapping.logger.profile('snap._addDependenciesGraphToComponents');\n }\n\n private _findWorkspaceCompByConsumerComp(consumerComponent: ConsumerComponent): Component | undefined {\n return this.allWorkspaceComps?.find((component) => component.id.isEqualWithoutVersion(consumerComponent.id));\n }\n\n private _getComponentIdByPkgNameMap(): Map<string, ComponentID> {\n if (!this.allWorkspaceComps) throw new Error('please make sure to populate this.allWorkspaceComps before');\n const componentIdByPkgName = new Map<string, ComponentID>();\n this.allComponentsToTag.forEach((consumerComponent) => {\n const component = this._findWorkspaceCompByConsumerComp(consumerComponent);\n if (component) {\n const pkgName = this.dependencyResolver.getPackageName(component);\n componentIdByPkgName.set(pkgName, consumerComponent.id);\n }\n });\n for (const workspaceComp of this.allWorkspaceComps) {\n if (\n this.allComponentsToTag.every(\n (snappedComponent) => !snappedComponent.id.isEqualWithoutVersion(workspaceComp.id)\n )\n ) {\n componentIdByPkgName.set(this.dependencyResolver.getPackageName(workspaceComp), workspaceComp.id);\n }\n }\n return componentIdByPkgName;\n }\n\n private async triggerOnPreSnap(autoTagIds: ComponentIdList) {\n const allFunctions = this.snapping.onPreSnapSlot.values();\n await mapSeries(allFunctions, (func) => func(this.components, autoTagIds, this.params));\n }\n\n private async addLaneObject(lane?: Lane) {\n if (lane) {\n const { message } = this.params;\n const msgStr = message ? ` (${message})` : '';\n const laneHistory = await this.legacyScope.lanes.updateLaneHistory(lane, `snap${msgStr}`);\n this.legacyScope.objects.add(laneHistory);\n }\n }\n\n private async build(harmonyCompsToTag: Component[], publishedPackages: string[]) {\n if (!this.params.build) {\n return;\n }\n const {\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n skipTasks,\n packageManagerConfigRootDir,\n exitOnFirstFailedTask,\n populateArtifactsIgnorePkgJson,\n skipTests,\n loose,\n } = this.params;\n const onTagOpts: OnTagOpts = {\n disableTagAndSnapPipelines,\n throwOnError: true,\n forceDeploy: ignoreBuildErrors,\n isSnap,\n populateArtifactsFrom,\n loose,\n };\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n const seedersOnly = !this.workspace; // if tag from scope, build only the given components\n const isolateOptions = { packageManagerConfigRootDir, seedersOnly, populateArtifactsIgnorePkgJson };\n const builderOptions = { exitOnFirstFailedTask, skipTests, skipTasks: skipTasksParsed, loose };\n\n const componentsToBuild = harmonyCompsToTag.filter((c) => !c.isDeleted());\n if (componentsToBuild.length) {\n const componentsToBuildLegacy: ConsumerComponent[] = componentsToBuild.map((c) => c.state._consumer);\n await this.scope.reloadAspectsWithNewVersion(componentsToBuildLegacy);\n const { builderDataMap } = await this.builder.tagListener(\n componentsToBuild,\n onTagOpts,\n isolateOptions,\n builderOptions\n );\n const buildResult = this.scope.builderDataMapToLegacyOnTagResults(builderDataMap);\n\n this.snapping._updateComponentsByTagResult(componentsToBuildLegacy, buildResult);\n const packageIntegritiesByPublishedPackages = this.snapping._getPublishedPackages(componentsToBuildLegacy);\n publishedPackages.push(...Array.from(packageIntegritiesByPublishedPackages.keys()));\n\n addIntegritiesToConsumerComponentsGraphs(packageIntegritiesByPublishedPackages, this.allComponentsToTag);\n this.addBuildStatus(componentsToBuildLegacy, BuildStatus.Succeed);\n await mapSeries(componentsToBuild, (comp) => this.snapping.enrichComp(comp));\n if (populateArtifactsFrom) await updateHiddenProp(this.scope, populateArtifactsFrom);\n }\n }\n\n private async checkForNewerVersions() {\n // check for each one of the components whether it is using an old version\n // TODO: once --detach-head is supported by the remote, deprecate --ignore-newest-version. and change this\n // throwForNewestVersion to suggest using --detach-head instead. also, it the error should not be limited\n // to tags and can be thrown for snaps as well.\n // once --ignore-newest-version is removed, no need for this condition. it's ok to not provide the override-head option.\n const { detachHead, ignoreNewestVersion, isSnap } = this.params;\n if (ignoreNewestVersion && !detachHead) this.params.overrideHead = true;\n if (!ignoreNewestVersion && !isSnap) {\n await throwForNewestVersion(this.allComponentsToTag, this.legacyScope);\n }\n }\n\n private async getMessagePerId(idsToTag: ComponentIdList, autoTagIds: ComponentIdList) {\n const messagesFromEditorFetcher = new MessagePerComponentFetcher(idsToTag, autoTagIds);\n const { editor, message, tagDataPerComp } = this.params;\n if (editor) return messagesFromEditorFetcher.getMessagesFromEditor(this.legacyScope.tmp, editor);\n if (tagDataPerComp) return tagDataPerComp.map((t) => ({ id: t.componentId, msg: t.message || message }));\n return [];\n }\n\n private getUniqCompsToTag(): ConsumerComponent[] {\n const consumerComponentsIdsMap = {};\n // Concat and unique all the dependencies from all the components so we will not import\n // the same dependency more then once, it's mainly for performance purpose\n this.consumerComponents.forEach((consumerComponent) => {\n const componentIdString = consumerComponent.id.toString();\n // Store it in a map so we can take it easily from the sorted array which contain only the id\n consumerComponentsIdsMap[componentIdString] = consumerComponent;\n });\n return Object.values(consumerComponentsIdsMap); // consumerComponents unique\n }\n\n private async getAutoTagData(idsToTag: ComponentIdList): Promise<AutoTagResult[]> {\n if (this.params.skipAutoTag) return [];\n if (!this.workspace) return this.getLaneAutoTagIdsFromScope(idsToTag);\n // ids without versions are new. it's impossible that tagged (and not-modified) components has\n // them as dependencies.\n const idsToTriggerAutoTag = idsToTag.filter((id) => id.hasVersion());\n const autoTagDataWithLocalOnly = await this.workspace.getAutoTagInfo(\n ComponentIdList.fromArray(idsToTriggerAutoTag)\n );\n const localOnly = this.workspace?.listLocalOnly();\n return localOnly\n ? autoTagDataWithLocalOnly.filter((autoTagItem) => !localOnly.hasWithoutVersion(autoTagItem.component.id))\n : autoTagDataWithLocalOnly;\n }\n\n private async getLaneAutoTagIdsFromScope(idsToTag: ComponentIdList): Promise<AutoTagResult[]> {\n const lane = await this.legacyScope.getCurrentLaneObject();\n if (!lane) return [];\n const laneCompIds = lane.toComponentIds();\n const graphIds = await this.scope.getGraphIds(laneCompIds);\n const dependentsMap = idsToTag.reduce(\n (acc, id) => {\n const dependents = graphIds.predecessors(id.toString());\n const dependentsCompIds = dependents.map((d) => d.attr);\n const dependentsCompIdsFromTheLane = dependentsCompIds.filter((s) => laneCompIds.has(s));\n if (!dependentsCompIdsFromTheLane.length) return acc;\n acc[id.toString()] = ComponentIdList.fromArray(dependentsCompIdsFromTheLane);\n return acc;\n },\n {} as Record<string, ComponentIdList>\n );\n if (Object.keys(dependentsMap).length === 0) return [];\n const allDependentsIds = ComponentIdList.uniqFromArray(Object.values(dependentsMap).flat());\n const allDependents = await this.legacyScope.getManyConsumerComponents(allDependentsIds);\n return allDependents.map((dependent) => {\n const triggeredByIds = Object.keys(dependentsMap).filter((id) => dependentsMap[id].has(dependent.id));\n const triggeredBy = ComponentIdList.fromStringArray(triggeredByIds);\n return { component: dependent, triggeredBy };\n });\n }\n\n private async setFutureVersions(autoTagIds: ComponentIdList): Promise<void> {\n const { releaseType, tagDataPerComp, incrementBy, persist, soft, exactVersion, preReleaseId } = this.params;\n const isPreReleaseLike = releaseType\n ? ['prerelease', 'premajor', 'preminor', 'prepatch'].includes(releaseType)\n : false;\n await Promise.all(\n this.allComponentsToTag.map(async (componentToTag) => {\n const isAutoTag = autoTagIds.hasWithoutVersion(componentToTag.id);\n const modelComponent = await this.legacyScope.sources.findOrAddComponent(componentToTag);\n const nextVersion = componentToTag.componentMap?.nextVersion?.version;\n const getNewVersion = (): string => {\n if (tagDataPerComp) {\n const tagData = tagDataPerComp.find((t) => t.componentId.isEqualWithoutVersion(componentToTag.id));\n if (!tagData) throw new Error(`tag-data is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n if (!tagData.versionToTag)\n throw new Error(`tag-data.TagResults is missing for ${componentToTag.id.toStringWithoutVersion()}`);\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(tagData.versionToTag);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n incrementBy,\n tagData.prereleaseId\n );\n }\n if (nextVersion && persist) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(nextVersion);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion,\n undefined,\n componentToTag.componentMap?.nextVersion?.preRelease\n );\n }\n if (isAutoTag) {\n // auto-tag always bumped as patch unless it's pre-release\n if (isPreReleaseLike) {\n return soft\n ? (releaseType as string)\n : modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n }\n return soft ? 'patch' : modelComponent.getVersionToAdd('patch', undefined, incrementBy, preReleaseId);\n }\n const versionByEnteredId = this.getVersionByEnteredId(this.ids, componentToTag, modelComponent);\n return soft\n ? versionByEnteredId || exactVersion || (releaseType as string)\n : versionByEnteredId ||\n modelComponent.getVersionToAdd(releaseType, exactVersion, incrementBy, preReleaseId);\n };\n const newVersion = getNewVersion();\n componentToTag.setNewVersion(newVersion);\n })\n );\n }\n\n private setCurrentSchema() {\n this.allComponentsToTag.forEach((component) => {\n component.schema = CURRENT_SCHEMA;\n });\n }\n\n private setHashes(): void {\n this.allComponentsToTag.forEach((componentToTag) => {\n componentToTag.setNewVersion(sha1(v4()));\n });\n }\n\n private getVersionByEnteredId(\n enteredIds: ComponentIdList,\n component: ConsumerComponent,\n modelComponent: ModelComponent\n ): string | undefined {\n const enteredId = enteredIds.searchWithoutVersion(component.id);\n if (enteredId && enteredId.hasVersion()) {\n const exactVersionOrReleaseType = getValidVersionOrReleaseType(enteredId.version as string);\n return modelComponent.getVersionToAdd(\n exactVersionOrReleaseType.releaseType,\n exactVersionOrReleaseType.exactVersion\n );\n }\n return undefined;\n }\n\n private addBuildStatus(components: ConsumerComponent[], buildStatus: BuildStatus) {\n components.forEach((component) => {\n component.buildStatus = component.isRemoved() ? BuildStatus.Skipped : buildStatus;\n });\n }\n\n /**\n * otherwise, tagging without build will have the old build data of the previous snap/tag.\n * in case we currently build, it's ok to leave the data as is, because it'll be overridden anyway.\n */\n private emptyBuilderData() {\n this.allComponentsToTag.forEach((component) => {\n component.extensions = component.extensions.clone();\n const existingBuilder = component.extensions.findCoreExtension(Extensions.builder);\n if (existingBuilder) existingBuilder.data = {};\n });\n }\n\n private updateDependenciesVersions() {\n // filter out removed components.\n // if a component has a deleted-component as a dependency, it was probably running \"bit install <dep>\" with a version\n // from main. we want to keep it as the user requested. Otherwise, this changes the dependency version to the newly\n // snapped one unintentionally.\n const componentsToTag = this.allComponentsToTag.filter((c) => !c.isRemoved());\n const getNewDependencyVersion = (id: ComponentID): ComponentID | null => {\n const foundDependency = componentsToTag.find((component) => component.id.isEqualWithoutVersion(id));\n return foundDependency ? id.changeVersion(foundDependency.version) : null;\n };\n const changeExtensionsVersion = (component: ConsumerComponent): void => {\n component.extensions.forEach((ext) => {\n if (ext.extensionId) {\n const newDepId = getNewDependencyVersion(ext.extensionId);\n if (newDepId) ext.extensionId = newDepId;\n }\n });\n };\n // in case we update dependencies according to the currently tagged component, we want to keep the versionRange\n // up to date with the new tags. e.g. 0.0.1 -> 0.0.2, will change the versionRange to ^0.0.2 or ~0.0.2.\n // in case componentRangePrefix is \"+\", we care only about packages in workspace.jsonc. so it won't be relevant.\n const updateDepsResolverData = (component: ConsumerComponent, componentRangePrefix?: ComponentRangePrefix) => {\n const entry = component.extensions.findCoreExtension(DependencyResolverAspect.id);\n if (!entry) {\n return component;\n }\n const dependencies = get(entry, ['data', 'dependencies'], []);\n dependencies.forEach((dep) => {\n if (dep.__type !== COMPONENT_DEP_TYPE) {\n return;\n }\n // @todo: it's unclear why \"dep.componentId\" randomly becomes a ComponentID instance.\n // this check is added because on Ripple in some scenarios it was throwing:\n // \"ComponentID.fromObject expect to get an object, got an instance of ComponentID\" (locally it didn't happen)\n const depId =\n dep.componentId instanceof ComponentID ? dep.componentId : ComponentID.fromObject(dep.componentId);\n const newDepId = getNewDependencyVersion(depId);\n dep.componentId = (newDepId || depId).serialize();\n dep.id = (newDepId || depId).toString();\n dep.version = (newDepId || depId).version;\n // if newDepId, then it means the dependency is in the current workspace and currently being tagged.\n // the versionRange needs to be updated to the new version.\n // However, for snaps, we should not apply range prefixes as they are not valid semver\n if (newDepId && (componentRangePrefix === '^' || componentRangePrefix === '~') && !isSnapVersion(dep.version)) {\n dep.versionRange = `${componentRangePrefix}${dep.version}`;\n }\n });\n return component;\n };\n\n componentsToTag.forEach((oneComponentToTag) => {\n const componentRangePrefix =\n this.dependencyResolver.calcComponentRangePrefixByConsumerComponent(oneComponentToTag);\n oneComponentToTag.getAllDependencies().forEach((dependency) => {\n const newDepId = getNewDependencyVersion(dependency.id);\n if (!newDepId) return;\n dependency.id = newDepId;\n // if componentRangePrefix === '+', then, only it only saves packages in workspace.jsonc.\n // in this case, these dependencies are in .bitmap. not in workspace.jsonc. so it's not relevant.\n // For snaps (hash versions), we should not apply range prefixes as they are not valid semver\n if ((componentRangePrefix === '^' || componentRangePrefix === '~') && !isSnapVersion(newDepId.version)) {\n dependency.versionRange = `${componentRangePrefix}${newDepId.version}`;\n }\n });\n changeExtensionsVersion(oneComponentToTag);\n oneComponentToTag = updateDepsResolverData(oneComponentToTag);\n });\n }\n\n private async addLogToComponents(\n components: ConsumerComponent[],\n autoTagComps: ConsumerComponent[],\n messagePerComponent: MessagePerComponent[]\n ) {\n let { message } = this.params;\n const { persist, copyLogFromPreviousSnap } = this.params;\n // @ts-ignore this happens when running `bit tag -m \"\"`.\n if (message === true) {\n message = '';\n }\n const basicLog = await getBasicLog();\n const getLog = (component: ConsumerComponent): Log => {\n const nextVersion = persist ? component.componentMap?.nextVersion : null;\n const msgFromEditor = messagePerComponent.find((item) => item.id.isEqualWithoutVersion(component.id))?.msg;\n if (copyLogFromPreviousSnap) {\n const currentLog = component.log;\n if (!currentLog) {\n throw new Error(\n `addLogToComponents is set copyLogFromPreviousSnap: true, but it is unable to find log in the previous snap`\n );\n }\n currentLog.message = msgFromEditor || message || currentLog.message;\n currentLog.date = basicLog.date;\n return currentLog;\n }\n\n return {\n username: nextVersion?.username || basicLog.username,\n email: nextVersion?.email || basicLog.email,\n message: nextVersion?.message || msgFromEditor || message,\n date: basicLog.date,\n };\n };\n\n components.forEach((component) => {\n component.log = getLog(component);\n });\n autoTagComps.forEach((autoTagComp) => {\n autoTagComp.log = getLog(autoTagComp);\n const defaultMsg = 'bump dependencies versions';\n if (message) {\n autoTagComp.log.message += ` (${defaultMsg})`;\n } else if (!autoTagComp.log.message) {\n autoTagComp.log.message = defaultMsg;\n }\n });\n }\n}\n\nasync function throwForNewestVersion(allComponentsToTag: ConsumerComponent[], legacyScope: Scope) {\n const newestVersionsP = allComponentsToTag.map(async (component) => {\n if (component.componentFromModel) {\n // otherwise it's a new component, so this check is irrelevant\n const modelComponent = await legacyScope.getModelComponentIfExist(component.id);\n if (!modelComponent) throw new BitError(`component ${component.id} was not found in the model`);\n if (!modelComponent.listVersions().length) return null; // no versions yet, no issues.\n const latest = modelComponent.getHeadRegardlessOfLaneAsTagOrHash();\n if (latest !== component.version) {\n return {\n componentId: component.id.toStringWithoutVersion(),\n currentVersion: component.version!,\n latestVersion: latest,\n };\n }\n }\n return null;\n });\n const newestVersions = await Promise.all(newestVersionsP);\n const newestVersionsWithoutEmpty = compact(newestVersions);\n if (newestVersionsWithoutEmpty.length) {\n throw new NewerVersionFound(newestVersionsWithoutEmpty);\n }\n}\n\nfunction addIntegritiesToConsumerComponentsGraphs(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n consumerComponents: ConsumerComponent[]\n) {\n const _addIntegritiesToDependenciesGraph = addIntegritiesToDependenciesGraph.bind(\n null,\n packageIntegritiesByPublishedPackages\n );\n for (const consumerComponent of consumerComponents) {\n if (consumerComponent.dependenciesGraph) {\n consumerComponent.dependenciesGraph = _addIntegritiesToDependenciesGraph(consumerComponent.dependenciesGraph);\n }\n }\n}\n\n/**\n * Updates the dependencies graph by replacing all \"pending\" version numbers of component dependencies\n * with the actual version numbers of the recently published packages. It also attaches the integrity\n * checksums of these components to ensure data integrity for each resolved dependency.\n *\n * @param packageIntegritiesByPublishedPackages - A map of package names and versions to their integrity checksums.\n * @param dependenciesGraph - The current dependencies graph, containing nodes with potentially \"pending\" versions.\n * @returns A new DependenciesGraph with updated versions and integrity checksums for all previously pending dependencies.\n */\nfunction addIntegritiesToDependenciesGraph(\n packageIntegritiesByPublishedPackages: PackageIntegritiesByPublishedPackages,\n dependenciesGraph: DependenciesGraph\n): DependenciesGraph {\n const resolvedVersions: Array<{ name: string; version: string; previouslyUsedVersion?: string }> = [];\n for (const [selector, { integrity, previouslyUsedVersion }] of packageIntegritiesByPublishedPackages.entries()) {\n if (integrity == null) continue;\n const index = selector.indexOf('@', 1);\n const name = selector.substring(0, index);\n const version = selector.substring(index + 1);\n const pendingPkg =\n dependenciesGraph.packages.get(`${name}@${previouslyUsedVersion}`) ??\n dependenciesGraph.packages.get(`${name}@${version}`);\n if (pendingPkg) {\n pendingPkg.resolution = { integrity };\n resolvedVersions.push({ name, version, previouslyUsedVersion });\n }\n }\n return replacePendingVersions(dependenciesGraph, resolvedVersions) as DependenciesGraph;\n}\n\nasync function removeDeletedComponentsFromBitmap(\n comps: ConsumerComponent[],\n workspace?: Workspace\n): Promise<ComponentIdList | undefined> {\n if (!workspace) {\n return undefined;\n }\n const removedComps = comps.filter((comp) => comp.isRemoved());\n if (!removedComps.length) return undefined;\n const compBitIdsToRemove = ComponentIdList.fromArray(removedComps.map((c) => c.id));\n await deleteComponentsFiles(workspace.consumer, compBitIdsToRemove);\n await workspace.consumer.cleanFromBitMap(compBitIdsToRemove);\n\n return compBitIdsToRemove;\n}\n\nasync function removeMergeConfigFromComponents(\n unmergedComps: ComponentID[],\n components: ConsumerComponent[],\n workspace?: Workspace\n) {\n if (!workspace || !unmergedComps.length) {\n return;\n }\n const configMergeFile = workspace.getConflictMergeFile();\n\n unmergedComps.forEach((compId) => {\n const isNowSnapped = components.find((c) => c.id.isEqualWithoutVersion(compId));\n if (isNowSnapped) {\n configMergeFile.removeConflict(compId.toStringWithoutVersion());\n }\n });\n const currentlyUnmerged = workspace ? await workspace.listComponentsDuringMerge() : [];\n if (configMergeFile.hasConflict() && currentlyUnmerged.length) {\n // it's possible that \"workspace\" section is still there. but if all \"unmerged\" are now merged,\n // then, it's safe to delete the file.\n await configMergeFile.write();\n } else {\n await configMergeFile.delete();\n }\n}\n\nexport type BitCloudUser = {\n username?: string;\n name?: string;\n displayName?: string;\n profileImage?: string;\n};\n\nfunction isAvailableOnMain(currentLane: LaneId, modelComponent: ModelComponent, id: ComponentID) {\n if (currentLane.isDefault()) {\n return true;\n }\n if (!id.hasVersion()) {\n // component was unsnapped on the current lane and is back to a new component\n return true;\n }\n return modelComponent.hasHead();\n}\n\nexport async function updateVersions(\n workspace: Workspace,\n stagedConfig: StagedConfig,\n currentLane: LaneId,\n modelComponent: ModelComponent,\n versionToSetInBitmap?: string, // helpful for detached head\n isTag = true\n) {\n const consumer = workspace.consumer;\n const idLatest: ComponentID = modelComponent.toBitIdWithLatestVersionAllowNull();\n const id = versionToSetInBitmap ? idLatest.changeVersion(versionToSetInBitmap) : idLatest;\n const isOnBitmap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion: true });\n if (!isOnBitmap && !isTag) {\n // handle the case when a component was deleted, snapped/tagged and is now reset.\n const stagedData = stagedConfig.getPerId(id);\n if (stagedData?.config && stagedData.config[RemoveAspect.id]) {\n consumer.bitMap.addFromComponentJson(stagedData.id, stagedData.componentMapObject);\n }\n }\n consumer.bitMap.updateComponentId(id, undefined, undefined, true);\n const availableOnMain = isAvailableOnMain(currentLane, modelComponent, id);\n if (!availableOnMain) {\n consumer.bitMap.setOnLanesOnly(id, true);\n }\n const componentMap = consumer.bitMap.getComponent(id);\n const compId = await workspace.resolveComponentId(id);\n // it can be either a tag/snap or reset.\n if (isTag) {\n const compMapObj = componentMap.toPlainObject();\n const config = componentMap.config;\n stagedConfig.addComponentConfig(compId, config, compMapObj);\n consumer.bitMap.removeConfig(id);\n const hash = modelComponent.getRef(id.version as string);\n if (!hash) throw new Error(`updateComponentsVersions: unable to find a hash for ${id.toString()}`);\n workspace.scope.legacyScope.stagedSnaps.addSnap(hash?.toString());\n } else if (!componentMap.config) {\n componentMap.config = stagedConfig.getConfigPerId(compId);\n }\n componentMap.clearNextVersion();\n}\n\nfunction replacePendingVersions(\n graph: DependenciesGraph,\n resolvedVersions: Array<{ name: string; version: string; previouslyUsedVersion?: string }>\n): DependenciesGraph {\n let s = graph.serialize();\n for (const { name, version, previouslyUsedVersion } of resolvedVersions) {\n if (previouslyUsedVersion) {\n s = s.replaceAll(`${name}@${previouslyUsedVersion}:`, `${name}@${version}`);\n }\n }\n const updatedDependenciesGraph = DependenciesGraph.deserialize(s);\n // This should never happen as we know at this point that the schema version is supported\n if (updatedDependenciesGraph == null) {\n throw new BitError('Failed to deserialize dependencies graph in replacePendingVersions()');\n }\n return updatedDependenciesGraph;\n}\n\n/**\n * relevant for \"_tag\" (tag-from-scope) command.\n * the new tag uses the same files/config/build-artifacts as the previous snap.\n * we want to mark the previous snap as hidden. so then \"bit log\" and \"bit blame\" won't show it.\n */\nasync function updateHiddenProp(scope: ScopeMain, ids: ComponentID[]) {\n const log = await getBasicLog();\n log.message = 'marked as hidden';\n await pMapPool(\n ids,\n async (id) => {\n const versionObj = await scope.getBitObjectVersionById(id);\n if (!versionObj) return;\n versionObj.hidden = true;\n versionObj.addModifiedLog(log);\n scope.legacyScope.objects.add(versionObj);\n },\n { concurrency: 50 }\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GA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