Many conventional commits of type feat on one feature branch
Asked Answered
H

1

6

I've been added to a repo which uses to automate bumping up the version of the NPM package. The repo uses the Conventional Commits specification and has a very limited README.

If I was to create a feature/ABC-123 branch which contains a new feature, does that mean every single commit I make should have a commit structure of feat: my message related to this commit or should I only have 1 feat commit and the rest chore or another type which does not bump up the version of the repo?

Or do I not need to worry about that as the branch is feature/ABC-123 and therefore knows to bump the package up by 1 minor version as it's in a feature folder?

Hopefully the above makes sense, but if not here is a commit history example:

feat: add product card basic layout
feat: add title to product card
test: add unit tests to product card
feat: add image to product card
chore: update breakpoints for card
test: add more unit tests

Would this example above bump the NPM package up by 3 minor versions as I've used feat 3 times, or one it only bump by 1 minor version? Or does this not matter and the only thing that matter is squashing the commits and ensuring feat: added product card for example is the squashed commit message?

Hymenium answered 12/11, 2020 at 21:48 Comment(0)
L
4

You can run semantic-release in dryRun mode and it will tell you what action it would take without actually taking it.

By default, given the commits you list, it would bump the minor version. It bumps based on the largest change in the set. You have no breaking changes, but you have a bunch of new features. It will not bump the version once for each feature if you run it after a series of commits. It will bump only once for the set.

Branch names are irrelevant as far as I know. It's all about the commit messages.

Lithopone answered 13/11, 2020 at 15:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.