carloscuesta / gitmoji

An emoji guide for your commit messages. šŸ˜œ
https://gitmoji.dev
MIT License
15.74k stars 799 forks source link

Conventional commit conversion #1317

Closed jpolo closed 1 year ago

jpolo commented 1 year ago

Description of the problem

Hi,

I have been working recently on various changelog scripts based on gitmoji. The difficulty is that almost every existing script is based upon conventional commit. Therefore the only solution is to fork and adapt the scripts to support / replace with gitmoji.

Depending on the context, those scripts are not always easy to modify because complicated (ex: semantic-release, etc).

Solution

A proposed solution would be to add a field "conventionalType" to gitmojis.json that would help to convert a gitmoji to a conventional commit type (ex: āœØ => feat) This way, instead of forking it would be easier to add gitmoji support for existing code.

In pseudo code, every package supporting conventional commit would have add this pseudo code to support also gitmoji :

const type = commit.type; // Either gitmoji or conventional commit
const conventionalType = isConventionalType(type) ? type : gitmojiToConventionalType(type);

Alternatives

No response

Additional context

No response

Validations

carloscuesta commented 1 year ago

Hey! šŸ‘‹šŸ¼

I think gitmoji and conventional-commits are completely different approaches when writing commits.

I'm not sure if understood properly the context of the problem but for me this sounds more like a "technical solution" to a specific problem rather than something that we want to implement in gitmoji šŸ¤”

Since both things are different I don't see the value of creating a map between gitmoji <> conventional commits

I have been working recently on various changelog scripts based on gitmoji.

Not sure what you're trying to achieve so can't give any recommendations but there's a tool for that see: https://github.com/frinyvonnick/gitmoji-changelog

You may also want to check the related tools page on the website for inspiration: https://gitmoji.dev/related-tools