Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing types seems to not do anything #78

Open
mattfelten opened this issue Nov 28, 2023 · 2 comments
Open

Customizing types seems to not do anything #78

mattfelten opened this issue Nov 28, 2023 · 2 comments

Comments

@mattfelten
Copy link

Following the Preset docs, it looks like preset can accept a types array where you can rename types and turn them off.

Here's what my .release-it.js file looks like:

module.exports = {
  npm: {
    publish: false,
  },
  git: {
    commitMessage: "chore: release v${version}",
    push: false,
    requireBranch: "main",
    requireCleanWorkingDir: true,
  },
  plugins: {
    "@release-it/conventional-changelog": {
      infile: "CHANGELOG.md",
      preset: {
        name: "conventionalcommits",
        types: [
          { type: "feat", section: "✨ New Features" },
          { type: "perf", section: "🚀 Performance" },
          { type: "fix", section: "🐛 Bug Fixes" },
          { type: "style", section: "💅 Visual Updates" },
          { type: "build", section: "🛠 Builds" },
          { type: "ci", section: "⚙️ CI" },
          { type: "docs", section: "📚 Documentation" },
          { type: "chore", hidden: true },
          { type: "refactor", hidden: true },
          { type: "test", hidden: true },
        ],
      },
      writerOpts: {
        transform(commit, context) {
          const jira = new RegExp(/MC-[0-9]+/, "i");
          if (jira.test(commit.scope)) {
            const [issue] = commit.scope.match(jira);
            commit.scope = `[${issue}](${jira_url}/${issue})`;
          }
          commit.shortHash = commit.hash.substring(0, 7);
          return commit;
        },
      },
    },
  },
  hooks: {
    "before:init": ["git fetch origin", "git reset --hard origin/main"],
    "after:release": "./.release/publish-prod.sh",
  },
};

But this is what was generated

## [1.72.0](<branch compare url>) (2023-11-28)


### feat

* ...


### chore

* ...


### fix

* ...


### refactor

* ...


### build

* ...

You can see that section names are not being used and also the chore and refactor sections which are supposed to be hidden are visible.

Is there another way of doing this?

@webpro
Copy link
Contributor

webpro commented Feb 15, 2024

Sorry, I don't really have an answer to this, other than checking out other issues in this repo and the docs of conventional-changelog (linked to in docs).

@webmatrixxxl
Copy link

webmatrixxxl commented Apr 20, 2024

@mattfelten I just tested it and it is working correctly for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants