Skip to content

Commit

Permalink
chore(changelog): added configuration for generating changelog (#74)
Browse files Browse the repository at this point in the history
The `standard-version` option is used for generating changelog
entries based on commit messages. In this action, I've specified
the types and sections using cool emojis. For now, all sections
are enabled.
  • Loading branch information
mdsanima authored Oct 25, 2023
1 parent 967a4c9 commit 5639077
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 89 deletions.
18 changes: 18 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"infile": "CHANGELOG.md",
"header": "<!-- markdownlint-disable -->\n\n# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nDocumentation for the [mdsanima-cli](https://pypi.org/project/mdsanima-cli) package is available in this repository in the [README.md](README.md) file. Be sure to check it.\n",
"skip": { "bump": false, "changelog": false, "commit": true, "tag": true },
"types": [
{ "type": "build", "section": "📦 Dependencies", "hidden": false },
{ "type": "chore", "section": "🧱 Tooling", "hidden": false },
{ "type": "ci", "section": "🎮 CI Actions", "hidden": false },
{ "type": "docs", "section": "📚 Documentation", "hidden": false },
{ "type": "feat", "section": "🐱‍👤 Features", "hidden": false },
{ "type": "fix", "section": "🐛 Bug Fixes", "hidden": false },
{ "type": "perf", "section": "🚀 Performance", "hidden": false },
{ "type": "refactor", "section": "♻️ Refactoring", "hidden": false },
{ "type": "revert", "section": "🤬 Reverting", "hidden": false },
{ "type": "style", "section": "🧢 Styling", "hidden": false },
{ "type": "test", "section": "🚧 Testing", "hidden": false }
]
}
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,31 @@ In this project, we use [Conventional Commits](https://www.conventionalcommits.o
Therefore, a crucial step is to commit your code changes using this specification. A commit message should look like this:

```shell
git commit -m "feat: generating pixel art command"
git commit -m "feat: added generating pixel art command"
```

Always use this format for committing to Git, as it enables generating a changelog from the commit message.

#### Standard Version

Check the [package.json](package.json) file in the **standard-version** section and in the types lists for the first string that you can use in the commit message or check the [examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) from _Conventional Commits_ documentation.
The [manifest.json](manifest.json) file is used to store the version number that generates the changelog. In the [.versionrc](.versionrc) file, there is a section that lists the types you can use in commit messages. You can also check the [examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) in the _Conventional Commits_ documentation.

Bump the package version in the [package.json](package.json) file and generate the [CHANGELOG.md](CHANGELOG.md) file with new release information, type the **standard-version** command to check first, type `npm run check-release` command in the terminal, and then add these changes to Git, committing the release like this:
The process is straightforward. First, update the version number in the [manifest.json](manifest.json) file and generate the [CHANGELOG.md](CHANGELOG.md) file with new release information.

Make sure that the `standard-version` package is installed on your system. If it's not, you need to install it globally on your system. You can do this by running the following command in your terminal:

```shell
npm install -g standard-version
```

Once it's installed, you can use the `standard-version --dry-run` command to check the output. You can use the `--help` flag to see the help.

The `standard-version` is configured to only bump versions and generate changelogs. In the [.versionrc](.versionrc) configuration file, you can set it up to also create commits and add Git tags with version numbers.

Now, after you've confirmed that it's working correctly, you can execute the following commands:

```shell
npm run release
standard-version
git commit -am "chore(release): v0.3.0"
```

Expand Down
4 changes: 4 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "mdsanima-cli",
"version": "0.3.0"
}
85 changes: 0 additions & 85 deletions package.json

This file was deleted.

0 comments on commit 5639077

Please sign in to comment.