frinyvonnick / gitmoji-changelog

A changelog generator for gitmoji 😜
https://www.npmjs.com/package/gitmoji-changelog
MIT License
390 stars 49 forks source link

Preset: read version from file #157

Closed jmfayard closed 4 years ago

jmfayard commented 4 years ago

Hello, I have found out about gitmoji-changelog at https://dev.to/yvonnickfrin/gitmoji-changelog-v2-is-out-51hb and really like the idea

I would like to use it for my project https://github.com/jmfayard/gradle-dependencies-plugins

To make it easy to setup the CI, my versions are in a simple file text

$ cat refreshVersions/plugins_version.txt
0.8.6
$ cat dependencies/plugins_version.txt
0.5.1

(that would be two changelogs, which is fine)

Not terribly complicated. The thing is that my javascript skills are closed to undefined so I would be really grateful if someone can write the corresponding preset for me

frinyvonnick commented 4 years ago

Hi @jmfayard,

Thank you for posting this feature request! I have a few questions.

Your project don't use gitmoji. Are you planning to follow it otherwise gitmoji-changelog won't works well since it uses it to classify commits in categories.

A preset needs at least 3 properties: a name, a description and a version. Your file only contains a version. You should define where the preset should look for these. The naming of your file seems a bit specific aswell?

The list of commits in your two changelogs will be the same? gitmoji-changelog uses tags to link commits to a version. I can't find out how you can have two differents versions in the same repository. I'm not really familiar with Kotlin version management. Maybe you can explain it to me a bit or at least give me a pointer to some documentation?

I wondering if a gradle plugin would be what you are really looking for?

Sorry for the huge amount of questions. I try to understand what you would best fit to your needs and remain useful for other users 👍

jmfayard commented 4 years ago

Hello @frinyvonnick

frinyvonnick commented 4 years ago

Ok so you want a sort of standalone preset that works regardless of the technology. Actually gitmoji-changelog use the .git folder to get commits so it doesn't take in account the current folder to filter commits. It is not monorepo friendly which is silly since gitmoji-changelog is a monorepo 😂

We have two issues here:

Thank you for your answers!

jmfayard commented 4 years ago

that sounds about right. relative to the first task, if you can come up with a simple file format that contain the information you need, I will update my project tu use that!

frinyvonnick commented 4 years ago

One last thing. In a previous comment I talked about tags. gitmoji-changelog uses tags to retrieve previous versions (also useful to determine which part of the changelog it can override and which part to let unchanged). I see you use tags but they seems related to only one of the projects, am I wrong? I bet this will lead to some weird result. I don't know how to deal with independent versioning in a monorepo.

jmfayard commented 4 years ago

I am not sure. Would that help if all my tags are like refreshVersions-x.y.z and dependencies-x.y.z ?

frinyvonnick commented 4 years ago

These are not semver but that could be a solution to handle a prefix in tags (I need to look for literature on that subject). The conversation about handling monorepos can be discussed in a separate issue. 👉 #158

frinyvonnick commented 4 years ago

@jmfayard I created a generic preset. You can test it with the canary version.

Here is how to use the generic preset:

  1. Create a file .gitmoji-changelogrc at the project root with the following content
{
  "project": {
    "name": "gradle-dependencies-plugins",
    "description": "Gradle dependencies with IDE integration and lookup for available updates",
    "version": "0.8.3"
  }
}
  1. Call gitmoji-changelog with the preset option set to generic
npx gitmoji-changelog@canary --preset generic

Hope it will help!

I'll publish it as soon as possible.