Skip to content

Add Custom Tag Format Support to Changeset Configuration - #1412

Open
kentnsw wants to merge 2 commits into
changesets:mainfrom
kentnsw:customizing-tag-format
Open

kentnsw wants to merge 2 commits into
changesets:mainfrom
kentnsw:customizing-tag-format

Conversation

@kentnsw

@kentnsw kentnsw commented Jul 12, 2024

Copy link
Copy Markdown

This PR introduces the ability to customize the format of version tags generated by the Changeset tool. By adding a new configuration item, tagFormat, users can now specify the structure of the tag names according to their project's conventions or requirements.

Key Changes:

  • Added tagFormat to the .changeset/config.json schema, allowing for dynamic tag names based on the package name and version.
  • Implemented string replacement functionality in the tagging process to substitute ${name} and ${version} placeholders with their respective values.

Usage: To utilize this feature, users should add the tagFormat item to their .changeset/config.json file, like so:

{
  "tagFormat": "${name}@${version}"
}

This configuration enables the creation of tags that follow the specified format, providing flexibility in tag naming conventions.

Benefits:

  • Customization: Users can tailor tag names to match their versioning guidelines or integrate seamlessly with other tools that expect a specific tag format.
  • Consistency: Ensures uniform tag naming across all packages within a monorepo, improving readability and manageability.

@changeset-bot

changeset-bot Bot commented Jul 12, 2024 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ef55eba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented Jul 12, 2024 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codecov

codecov Bot commented Jul 12, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.04%. Comparing base (b593756) to head (2a541a6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1412      +/-   ##
==========================================
+ Coverage   81.02%   81.04%   +0.02%     
==========================================
  Files          54       54              
  Lines        2213     2216       +3     
  Branches      654      657       +3     
==========================================
+ Hits         1793     1796       +3     
  Misses        416      416              
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kentnsw

kentnsw commented Jul 12, 2024

Copy link
Copy Markdown
Author

I thought it would be an easy one. I am new to Changesets and need a hand here. :)

@vaso991

vaso991 commented Jul 23, 2024

Copy link
Copy Markdown

+1, need this change

@IlyaSemenov

Copy link
Copy Markdown

This is super needed. Sometimes I rename a package and re-release it under a new name, starting with v1.0.0.
With how changesets works, it will create a new tag v1.0.0 and fail to push it because the old package already had v1.0.0.
Hence I'd rather use package-name@version for ALL repos, even non-monorepo. This is not currently possible without this patch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants