convention_change_log

package module
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

ci license go mod version GoDoc GoReportCard codecov GitHub release)

for what

  • convention change log generate
  • convention change log reader
  • convention change log config by .versionrc file

Features

  • subcommand init to init config file
    • init .versionrc file at git repository root path, as default config file
{
  "types": [
    {"type": "feat", "section": "✨ Features", "hidden": false},
    {"type": "fix", "section": "🐛 Bug Fixes", "hidden": false},
    {"type": "docs", "section":"📝 Documentation", "hidden": true},
    {"type": "style", "section":"💄 Styles", "hidden": true},
    {"type": "refactor", "section":"♻ Refactor", "hidden": false},
    {"type": "perf", "section":"⚡ Performance Improvements", "hidden": false},
    {"type": "test", "section":"✅ Tests", "hidden": true},
    {"type": "build", "section":"👷‍ Build System", "hidden": false},
    {"type": "ci", "section":"🔧 Continuous Integration", "hidden": true},
    {"type": "chore", "section":"📦 Chores", "hidden": true},
    {"type": "revert", "section":"⏪ Reverts", "hidden": false}
  ],
  "tag-prefix": "v"
}
  • can read git root .versionrc for setting of change log generate
    • support change log item sort by versionrc config {{ .types[ .sort ] }}, and default sort will auto set by this kit
    • more settings use init --more to generate .versionrc file
  • subcommand read-latest read the latest change log or write latest change to file
    • --read-latest-file read change log file path (default: "CHANGELOG.md")
    • --read-latest-out flag can open output to file, not settings will not output
      • --read-latest-out-path write last change file path (default: "CHANGELOG.txt")
  • global flag
    • --dry-run flag can see what change of new release
    • -r or --release-as to set release version
      • when not set will auto generate release version
        • commit message contains feat: will update MINOR version
        • commit message not contains feat: will update MAJOR version
    • --auto-push flag can auto push tag to remote
    • --tag-prefix flag can change tag prefix, default will use .versionrc config tag-prefix
  • generate from conventional commits for semver.org
    • default will update PATCH version
    • if the latest list has any feat message will update MINOR version
    • if you want change release version please use global flag -r
  • auto update version resource
    • project has package.json file, will auto update version field
    • project has package-lock.json file, will try use npm install to update package-lock.json file
    • in .versionrc has monorepo-pkg-path field as string list, will auto update package.json file in monorepo-pkg-path path (v1.5.+)
{
  "monorepo-pkg-path": [
    "pkg1",
    "pkg2"
  ]
}
  • more perfect test case coverage

more use see convention-change-log --help

usage

cli

# install at $(GO_PATH)/bin
$ go install -v github.com/convention-change/convention-change-log/cmd/convention-change-log@latest
# install version v1.6.0
$ go install -v github.com/convention-change/convention-change-log/cmd/convention-change-log@v1.6.0
  • or install by release and add environment variables PATH

  • please use cli at git repository root path

## init config
# init config file at git repository root path
$ convention-change-log init

## generate change log, this must run repository root path and project must management by git
# with dry run
# check release note by dry run
$ convention-change-log --dry-run
# let release version as -r and dry run
$ convention-change-log -r 0.1.0 --dry-run
# change tag prefix
$ convention-change-log -r 0.1.0 -t "" --dry-run

# finish check then generate release note and tag
$ convention-change-log -r 1.0.0
# or add auto push to remote
$ convention-change-log --auto-push

## read-latest
# read and output to stdout
$ convention-change-log read-latest
# read and output to file
$ convention-change-log read-latest --read-latest-out

dev

env

  • minimum go version: go 1.19
  • change go 1.19, ^1.19, 1.19.13 to new go version

libs

lib version
https://github.com/stretchr/testify v1.9.0
https://github.com/sebdah/goldie v2.5.3

Contributing

Contributor Covenant GitHub contributors

We welcome community contributions to this project.

Please read Contributor Guide for more information on how to get started.

请阅读有关 贡献者指南 以获取更多如何入门的信息

local dev

# It needs to be executed after the first use or update of dependencies.
$ make init dep
  • test code
$ make test testBenchmark

add main.go file and run

# run at env dev use cmd/main.go
$ make dev
  • ci to fast check
# check style at local
$ make style

# run ci at local
$ make ci

docker

# then test build as test/Dockerfile
$ make dockerTestRestartLatest
# clean test build
$ make dockerTestPruneLatest

# more info see
$ make helpDocker

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageJson string
View Source
var ResVersionRcBeautyJson string

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL