@teambit/snapping 1.0.682 → 1.0.684
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/snapping.main.runtime.d.ts +1 -1
- package/dist/snapping.main.runtime.js +2 -0
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.d.ts +1 -0
- package/dist/tag-cmd.js +3 -1
- package/dist/tag-cmd.js.map +1 -1
- package/dist/version-file-parser.d.ts +8 -0
- package/dist/version-file-parser.js +119 -0
- package/dist/version-file-parser.js.map +1 -0
- package/dist/version-maker.d.ts +2 -0
- package/dist/version-maker.js +18 -0
- package/dist/version-maker.js.map +1 -1
- package/package.json +34 -34
- /package/dist/{preview-1754325640588.js → preview-1754416285019.js} +0 -0
package/dist/tag-cmd.js
CHANGED
|
@@ -43,7 +43,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
43
43
|
const NOTHING_TO_TAG_MSG = exports.NOTHING_TO_TAG_MSG = 'nothing to tag';
|
|
44
44
|
const AUTO_TAGGED_MSG = exports.AUTO_TAGGED_MSG = 'auto-tagged dependents';
|
|
45
45
|
const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];
|
|
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.
|
|
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).'], ['', 'versions-file <path>', 'path to a file containing component versions. format: "component-id: version"'], ['v', 'ver <version>', 'tag with the given version'], ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`], ['', 'prerelease-id <id>', 'prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")'], ['p', 'patch', 'syntactic sugar for "--increment patch"'], ['', 'minor', 'syntactic sugar for "--increment minor"'], ['', 'major', 'syntactic sugar for "--increment major"'], ['', 'pre-release [identifier]', 'syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`'], ['', '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
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']];
|
|
@@ -79,6 +79,7 @@ if patterns are entered, you can specify a version per pattern using "@" sign, e
|
|
|
79
79
|
message = '',
|
|
80
80
|
ver,
|
|
81
81
|
editor = '',
|
|
82
|
+
versionsFile,
|
|
82
83
|
snapped = false,
|
|
83
84
|
unmerged = false,
|
|
84
85
|
ignoreIssues,
|
|
@@ -123,6 +124,7 @@ To undo local tag use the "bit reset" command.`);
|
|
|
123
124
|
snapped,
|
|
124
125
|
unmerged,
|
|
125
126
|
editor,
|
|
127
|
+
versionsFile,
|
|
126
128
|
message,
|
|
127
129
|
releaseType,
|
|
128
130
|
preReleaseId,
|
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","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 type { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { DEFAULT_BIT_RELEASE_TYPE, COMPONENT_PATTERN_HELP, CFG_FORCE_LOCAL_BUILD } from '@teambit/legacy.constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { TagResults, SnappingMain } from './snapping.main.runtime';\nimport type { BasicTagParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport const NOTHING_TO_TAG_MSG = 'nothing to tag';\nexport const AUTO_TAGGED_MSG = 'auto-tagged dependents';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\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,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,G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G,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":[]}
|
|
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","versionsFile","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 type { ComponentIdList, ComponentID } from '@teambit/component-id';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { DEFAULT_BIT_RELEASE_TYPE, COMPONENT_PATTERN_HELP, CFG_FORCE_LOCAL_BUILD } from '@teambit/legacy.constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { TagResults, SnappingMain } from './snapping.main.runtime';\nimport type { BasicTagParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport const NOTHING_TO_TAG_MSG = 'nothing to tag';\nexport const AUTO_TAGGED_MSG = 'auto-tagged dependents';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n\nexport const tagCmdOptions = [\n ['m', 'message <message>', 'a log message describing latest changes'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\n ['', 'versions-file <path>', 'path to a file containing component versions. format: \"component-id: version\"'],\n ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', '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 versionsFile?: string;\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 versionsFile,\n snapped = false,\n unmerged = false,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipTasks,\n skipAutoTag = false,\n unmodified = false,\n soft = false,\n persist = false,\n disableTagPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n 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 versionsFile,\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;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I,CAAC,IAAI;AACpG","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentIdList } from '@teambit/component-id';
|
|
2
|
+
import type { TagDataPerComp } from './snapping.main.runtime';
|
|
3
|
+
export declare class VersionFileParser {
|
|
4
|
+
private componentsToTag;
|
|
5
|
+
constructor(componentsToTag: ComponentIdList);
|
|
6
|
+
parseVersionsFile(filePath: string): Promise<TagDataPerComp[]>;
|
|
7
|
+
parseVersionsContent(fileContent: string): TagDataPerComp[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VersionFileParser = void 0;
|
|
7
|
+
function _fsExtra() {
|
|
8
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
9
|
+
_fsExtra = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _bitError() {
|
|
15
|
+
const data = require("@teambit/bit-error");
|
|
16
|
+
_bitError = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
class VersionFileParser {
|
|
23
|
+
constructor(componentsToTag) {
|
|
24
|
+
this.componentsToTag = componentsToTag;
|
|
25
|
+
}
|
|
26
|
+
async parseVersionsFile(filePath) {
|
|
27
|
+
if (!(await _fsExtra().default.pathExists(filePath))) {
|
|
28
|
+
throw new (_bitError().BitError)(`versions file not found: ${filePath}`);
|
|
29
|
+
}
|
|
30
|
+
const fileContent = await _fsExtra().default.readFile(filePath, 'utf-8');
|
|
31
|
+
return this.parseVersionsContent(fileContent);
|
|
32
|
+
}
|
|
33
|
+
parseVersionsContent(fileContent) {
|
|
34
|
+
const lines = fileContent.split('\n').map(line => line.trim()).filter(line => line && !line.startsWith('#'));
|
|
35
|
+
const results = [];
|
|
36
|
+
let defaultVersion;
|
|
37
|
+
|
|
38
|
+
// Create a map for faster component lookup
|
|
39
|
+
const componentsByName = new Map();
|
|
40
|
+
for (const comp of this.componentsToTag) {
|
|
41
|
+
componentsByName.set(comp.toStringWithoutVersion(), comp);
|
|
42
|
+
}
|
|
43
|
+
for (const line of lines) {
|
|
44
|
+
// Handle default version
|
|
45
|
+
if (line.startsWith('DEFAULT:')) {
|
|
46
|
+
defaultVersion = line.replace('DEFAULT:', '').trim();
|
|
47
|
+
if (!defaultVersion) {
|
|
48
|
+
throw new (_bitError().BitError)('DEFAULT version cannot be empty');
|
|
49
|
+
}
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Parse component line: "component-id: version"
|
|
54
|
+
const colonIndex = line.indexOf(':');
|
|
55
|
+
if (colonIndex === -1) {
|
|
56
|
+
throw new (_bitError().BitError)(`invalid line format: "${line}". Expected format: "component-id: version"`);
|
|
57
|
+
}
|
|
58
|
+
const componentIdStr = line.substring(0, colonIndex).trim();
|
|
59
|
+
const version = line.substring(colonIndex + 1).trim();
|
|
60
|
+
if (!componentIdStr || !version) {
|
|
61
|
+
throw new (_bitError().BitError)(`invalid line format: "${line}". Expected format: "component-id: version"`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Find the component ID in our list
|
|
65
|
+
const componentId = componentsByName.get(componentIdStr);
|
|
66
|
+
if (!componentId) {
|
|
67
|
+
// Component not in the current tagging list - skip it
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Extract prerelease ID if present
|
|
72
|
+
let prereleaseId;
|
|
73
|
+
if (version.includes('-')) {
|
|
74
|
+
const prereleaseMatch = version.match(/-([^.]+)/);
|
|
75
|
+
if (prereleaseMatch) {
|
|
76
|
+
prereleaseId = prereleaseMatch[1];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
results.push({
|
|
80
|
+
componentId,
|
|
81
|
+
dependencies: [],
|
|
82
|
+
// Will be populated by the calling code
|
|
83
|
+
versionToTag: version,
|
|
84
|
+
prereleaseId,
|
|
85
|
+
message: undefined,
|
|
86
|
+
// Messages handled separately via --message or --editor
|
|
87
|
+
isNew: false // Will be determined by the calling code
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// For components not specified in the file, use default version if provided
|
|
92
|
+
if (defaultVersion) {
|
|
93
|
+
const specifiedIds = new Set(results.map(r => r.componentId.toStringWithoutVersion()));
|
|
94
|
+
for (const componentId of this.componentsToTag) {
|
|
95
|
+
if (!specifiedIds.has(componentId.toStringWithoutVersion())) {
|
|
96
|
+
let prereleaseId;
|
|
97
|
+
if (defaultVersion.includes('-')) {
|
|
98
|
+
const prereleaseMatch = defaultVersion.match(/-([^.]+)/);
|
|
99
|
+
if (prereleaseMatch) {
|
|
100
|
+
prereleaseId = prereleaseMatch[1];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
results.push({
|
|
104
|
+
componentId,
|
|
105
|
+
dependencies: [],
|
|
106
|
+
versionToTag: defaultVersion,
|
|
107
|
+
prereleaseId,
|
|
108
|
+
message: undefined,
|
|
109
|
+
isNew: false
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return results;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.VersionFileParser = VersionFileParser;
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=version-file-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bitError","e","__esModule","default","VersionFileParser","constructor","componentsToTag","parseVersionsFile","filePath","fs","pathExists","BitError","fileContent","readFile","parseVersionsContent","lines","split","map","line","trim","filter","startsWith","results","defaultVersion","componentsByName","Map","comp","set","toStringWithoutVersion","replace","colonIndex","indexOf","componentIdStr","substring","version","componentId","get","prereleaseId","includes","prereleaseMatch","match","push","dependencies","versionToTag","message","undefined","isNew","specifiedIds","Set","r","has","exports"],"sources":["version-file-parser.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport type { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport type { TagDataPerComp } from './snapping.main.runtime';\n\nexport class VersionFileParser {\n constructor(private componentsToTag: ComponentIdList) {}\n\n async parseVersionsFile(filePath: string): Promise<TagDataPerComp[]> {\n if (!(await fs.pathExists(filePath))) {\n throw new BitError(`versions file not found: ${filePath}`);\n }\n\n const fileContent = await fs.readFile(filePath, 'utf-8');\n return this.parseVersionsContent(fileContent);\n }\n\n parseVersionsContent(fileContent: string): TagDataPerComp[] {\n const lines = fileContent\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line && !line.startsWith('#'));\n\n const results: TagDataPerComp[] = [];\n let defaultVersion: string | undefined;\n\n // Create a map for faster component lookup\n const componentsByName = new Map<string, ComponentID>();\n for (const comp of this.componentsToTag) {\n componentsByName.set(comp.toStringWithoutVersion(), comp);\n }\n\n for (const line of lines) {\n // Handle default version\n if (line.startsWith('DEFAULT:')) {\n defaultVersion = line.replace('DEFAULT:', '').trim();\n if (!defaultVersion) {\n throw new BitError('DEFAULT version cannot be empty');\n }\n continue;\n }\n\n // Parse component line: \"component-id: version\"\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n const componentIdStr = line.substring(0, colonIndex).trim();\n const version = line.substring(colonIndex + 1).trim();\n\n if (!componentIdStr || !version) {\n throw new BitError(`invalid line format: \"${line}\". Expected format: \"component-id: version\"`);\n }\n\n // Find the component ID in our list\n const componentId = componentsByName.get(componentIdStr);\n if (!componentId) {\n // Component not in the current tagging list - skip it\n continue;\n }\n\n // Extract prerelease ID if present\n let prereleaseId: string | undefined;\n if (version.includes('-')) {\n const prereleaseMatch = version.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [], // Will be populated by the calling code\n versionToTag: version,\n prereleaseId,\n message: undefined, // Messages handled separately via --message or --editor\n isNew: false, // Will be determined by the calling code\n });\n }\n\n // For components not specified in the file, use default version if provided\n if (defaultVersion) {\n const specifiedIds = new Set(results.map((r) => r.componentId.toStringWithoutVersion()));\n\n for (const componentId of this.componentsToTag) {\n if (!specifiedIds.has(componentId.toStringWithoutVersion())) {\n let prereleaseId: string | undefined;\n if (defaultVersion.includes('-')) {\n const prereleaseMatch = defaultVersion.match(/-([^.]+)/);\n if (prereleaseMatch) {\n prereleaseId = prereleaseMatch[1];\n }\n }\n\n results.push({\n componentId,\n dependencies: [],\n versionToTag: defaultVersion,\n prereleaseId,\n message: undefined,\n isNew: false,\n });\n }\n }\n }\n\n return results;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvC,MAAMG,iBAAiB,CAAC;EAC7BC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEvD,MAAMC,iBAAiBA,CAACC,QAAgB,EAA6B;IACnE,IAAI,EAAE,MAAMC,kBAAE,CAACC,UAAU,CAACF,QAAQ,CAAC,CAAC,EAAE;MACpC,MAAM,KAAIG,oBAAQ,EAAC,4BAA4BH,QAAQ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,cAAc,CAACiB,KAAK,CAAC,UAAU,CAAC;YACxD,IAAID,eAAe,EAAE;cACnBF,YAAY,GAAGE,eAAe,CAAC,CAAC,CAAC;YACnC;UACF;UAEAjB,OAAO,CAACmB,IAAI,CAAC;YACXN,WAAW;YACXO,YAAY,EAAE,EAAE;YAChBC,YAAY,EAAEpB,cAAc;YAC5Bc,YAAY;YACZO,OAAO,EAAEC,SAAS;YAClBC,KAAK,EAAE;UACT,CAAC,CAAC;QACJ;MACF;IACF;IAEA,OAAOxB,OAAO;EAChB;AACF;AAAC6B,OAAA,CAAA/C,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/dist/version-maker.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type BasicTagParams = BasicTagSnapParams & {
|
|
|
26
26
|
disableTagAndSnapPipelines?: boolean;
|
|
27
27
|
preReleaseId?: string;
|
|
28
28
|
editor?: string;
|
|
29
|
+
versionsFile?: string;
|
|
29
30
|
unmodified?: boolean;
|
|
30
31
|
};
|
|
31
32
|
export type VersionMakerParams = {
|
|
@@ -75,6 +76,7 @@ export declare class VersionMaker {
|
|
|
75
76
|
private build;
|
|
76
77
|
private checkForNewerVersions;
|
|
77
78
|
private getMessagePerId;
|
|
79
|
+
private parseVersionsFile;
|
|
78
80
|
private getUniqCompsToTag;
|
|
79
81
|
private getAutoTagData;
|
|
80
82
|
private getLaneAutoTagIdsFromScope;
|
package/dist/version-maker.js
CHANGED
|
@@ -117,6 +117,13 @@ function _messagePerComponent() {
|
|
|
117
117
|
};
|
|
118
118
|
return data;
|
|
119
119
|
}
|
|
120
|
+
function _versionFileParser() {
|
|
121
|
+
const data = require("./version-file-parser");
|
|
122
|
+
_versionFileParser = function () {
|
|
123
|
+
return data;
|
|
124
|
+
};
|
|
125
|
+
return data;
|
|
126
|
+
}
|
|
120
127
|
function _dependencyResolver() {
|
|
121
128
|
const data = require("@teambit/dependency-resolver");
|
|
122
129
|
_dependencyResolver = function () {
|
|
@@ -170,6 +177,7 @@ class VersionMaker {
|
|
|
170
177
|
const autoTagIds = _componentId().ComponentIdList.fromArray(autoTagComponentsFiltered.map(autoTag => autoTag.id));
|
|
171
178
|
await this.triggerOnPreSnap(autoTagIds);
|
|
172
179
|
this.allComponentsToTag = [...componentsToTag, ...autoTagComponentsFiltered];
|
|
180
|
+
await this.parseVersionsFile(idsToTag, autoTagIds);
|
|
173
181
|
const messagePerId = await this.getMessagePerId(idsToTag, autoTagIds);
|
|
174
182
|
await this.checkForNewerVersions();
|
|
175
183
|
this.setCurrentSchema();
|
|
@@ -395,6 +403,16 @@ class VersionMaker {
|
|
|
395
403
|
}));
|
|
396
404
|
return [];
|
|
397
405
|
}
|
|
406
|
+
async parseVersionsFile(idsToTag, autoTagIds) {
|
|
407
|
+
const {
|
|
408
|
+
versionsFile
|
|
409
|
+
} = this.params;
|
|
410
|
+
if (!versionsFile) return;
|
|
411
|
+
const allComponentsToTag = _componentId().ComponentIdList.fromArray([...idsToTag, ...autoTagIds]);
|
|
412
|
+
const versionFileParser = new (_versionFileParser().VersionFileParser)(allComponentsToTag);
|
|
413
|
+
const tagDataFromFile = await versionFileParser.parseVersionsFile(versionsFile);
|
|
414
|
+
this.params.tagDataPerComp = tagDataFromFile;
|
|
415
|
+
}
|
|
398
416
|
getUniqCompsToTag() {
|
|
399
417
|
const consumerComponentsIdsMap = {};
|
|
400
418
|
// Concat and unique all the dependencies from all the components so we will not import
|