semantic-release-version-badge
v1.0.6
Published
A plugin for semantic-release that updates version badge in README file with latest bumped version
Maintainers
Readme
semantic-release-version-badge
A semantic-release plugin that updates version badge in README file with the latest released version.
Installation
npm install --save-dev semantic-release-version-badgeUsage
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"semantic-release-version-badge"
]
}Configuration
Plugin Options
| Option | Description | Default |
|---------------|--------------------------------------------------------------|--------------------------------------------------------------|
| badgeTemplate| Template string for the version badge |  |
| readmePath | Path to the README file | README.md |
Example Configuration
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["semantic-release-version-badge", {
"badgeTemplate": "",
"readmePath": "./docs/README.md"
}]
]
}How it Works
The plugin runs during the prepare phase of semantic-release. It:
- Reads the specified README file
- Updates the version badge using the new version
- Writes the changes back to the file
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Development Setup
# Clone the repository
git clone https://github.com/lcaparros/semantic-release-version-badge.git
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm testCommit Convention
This project follows Conventional Commits specification. Each commit message must be structured as follows:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]Types
feat: (Minor) New feature or significant enhancementfix: (Patch) Bug fixdocs: (Patch) Documentation updatesstyle: (No Release) Code formatting changesrefactor: (Patch) Code restructuring without behavior changeperf: (Patch) Performance improvementstest: (No Release) Adding/modifying testsbuild: (Patch) Changes affecting build systemci: (No Release) Changes to CI configurationchore: (No Release) Maintenance tasksrevert: (Special) Reverts a previous commit
Scopes
Common scopes include:
auth: Authentication related changesapi: API endpointsdb: Database changesemail: Email functionalitysecurity: Security featuresui: User interfacedocs: Documentationtests: Test infrastructure
Examples
feat(auth): add password reset functionalityfix(email): handle sendgrid connection timeoutdocs(readme): update installation stepsstyle(lint): format code according to prettier rulesrefactor(api): simplify error handlingBreaking Changes
For breaking changes:
- Add
!after type/scope - Add
BREAKING CHANGE:in footer
Example:
feat(auth)!: change authentication token format
BREAKING CHANGE: New token format is not backward compatible with existing clientsVersion Impact
- Breaking changes (
!) -> Major version bump feat-> Minor version bumpfix,perf,refactor-> Patch version bumpdocs,style,test,ci,chore-> No version bump
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
