What can this thing do?

  • Automatic upgrade version
  • Automatically play tag
  • Changelog is automatically generated

Automatic upgrade version

Version of the form

The version number major. Minor. Patch

Default version update rules

  • Feature updates minor
  • Bug fix updates patches
  • BREAKING CHANGES updates major

Manually control version updates

Direct upgrademajor

package.json

package.json

"scripts": {
"release-major": "standard-version --release-as major",}Copy the code

Direct upgrademinor

package.json

"scripts": {
"release-minor": "standard-version --release-as minor",}Copy the code

Direct upgradepatch

package.json

"scripts": {
"release-patch": "standard-version --release-as patch",}Copy the code

Upgrade the version by default

package.json

"scripts": {
"release": "standard-version",}Copy the code

Force a static version number

package.json

"scripts": {
"release-static": "Standard version - release - as 3.3.3",}Copy the code

First version (this method does not upgrade the version number)

# npm run script
npm run release -- --first-release
# global bin
standard-version --first-release
# npx
npx standard-version --first-release
Copy the code

Configure which COMMIT messages are written to Changelog

The hidden property value controls whether a commit message of this type is written to the Changlog. The default is false if this type is left blank

.versionrc.js

Module. Exports = {" types ": [{" type" : "feat", "section" : "✨ the Features | new feature"}, {" type ":" fix ", "section" : "🐛 Bug Fixes | Bug Fixes"}, {" type ":" init ", "section" : "🎉 init | initialization"}, {" type ":" docs ", "section" : "✏ ️ Documentation | document"}, {" type ":" style ", "section" : "💄 Styles | style"}, {" type ":" refactor ", "section" : "♻ ️ Code Refactoring | Code Refactoring"}, {" type ":" perf ", "section" : "⚡ Performance Improvements | Performance optimization"}, {" type ": "Test", "section", "✅ Tests | testing"}, {" type ":" revert ", "section" : "⏪ revert | back", "hidden" : true}, {" type ": "Build" and "section", "📦 build System | pack to build"}, {" type ":" chore ", "section" : "🚀 chore | build/project/tool to"}, {" type ": "Ci", "section" : "👷 Continuous Integration | ci configuration"}}]Copy the code

Skip the changelog generation step

package.json

All configurable skips are: Bump, Changelog, Commit, tag

{
  "standard-version": {
    "skip": {
      "changelog": true
    }
  }
}
Copy the code