question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How to configure "angular" preset to print docs, style, etc.

See original GitHub issue

Hi guys, i made a lot of research and even sniffed the repositories to find a proper solution but it doesn’t work out for me. Therefore i decided to ask here for help.

My goal is to generateNotes even for commits prefixed with docs:, style:, ci:, etc. Right now only fix:, feat: and breacking change are printed to CHANGELOG.md and GitHub releases.

My configuration looks like this:

{
    "release": {
        "verifyConditions": [
            "@semantic-release/changelog",
            "@semantic-release/github"
        ],
        "analyzeCommits": {
            "preset": "angular",
            "releaseRules": [
                {
                    "type": "docs",
                    "release": "patch"
                },
                {
                    "type": "refactor",
                    "release": "patch"
                },
                {
                    "type": "style",
                    "release": "patch"
                }
            ]
        },
        "generateNotes": {
            "preset": "angular"
        },
        "prepare": [
            "@semantic-release/changelog",
            "@semantic-release/git"
        ],
        "publish": [
            "@semantic-release/github"
        ]
    }
}

I know that angular is the default preset for generateNotes but i added it to be explicit for everyone.

I appreciate every single hint, link or solution snippet.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
MaiKaYcommented, May 18, 2018

Hi @damianopetrungaro, thanks a lot for your answer!

I my point of view the issue is at this specific point: https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/writer-opts.js#L44-L45

I now created a release.config.js in my project(s) with the following writerOpts.transform:

'transform': (commit, context) => {
    if (commit.type === 'feat') {
        commit.type = 'Features';
    } else if (commit.type === 'fix') {
        commit.type = 'Bug Fixes';
    } else if (commit.type === 'perf') {
        commit.type = 'Performance Improvements';
    } else if (commit.type === 'revert') {
        commit.type = 'Reverts';
    } else if (commit.type === 'docs') {
        commit.type = 'Documentation';
    } else if (commit.type === 'style') {
        commit.type = 'Styles';
    } else if (commit.type === 'refactor') {
        commit.type = 'Code Refactoring';
    } else if (commit.type === 'test') {
        commit.type = 'Tests';
    } else if (commit.type === 'build') {
        commit.type = 'Build System';
    } else if (commit.type === 'ci') {
        commit.type = 'Continuous Integration';
    } else if (commit.type === 'chore') {
        commit.type = 'Chores';
    } else {
        return;
    }

    [...]

    return commit
}

This works perfectly. The only thing what i did was to remove the line mentioned above.

2reactions
elizabethsjuddcommented, Mar 17, 2020

We’ve ran in to this same issue as well and have also copy and pasted the transform function in to our config. It’d be really nice to have a flag or something to turn off that one specific else if given everything else is exactly the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure "angular" preset to print docs, style, etc ...
My goal is to generateNotes even for commits prefixed with docs: , style: , ci: , etc. Right now only fix: , feat:...
Read more >
Print Html template in Angular 2 (ng-print in Angular 2)
For getting the existing styles to preserve the look 'n feel of the targeted component, you can: make a query to pull the...
Read more >
Getting started with Angular
Pass data to a child componentlink · The selector , app-product-alerts , identifies the component. · The template and style filenames reference the...
Read more >
48 answers on StackOverflow to the most popular Angular ...
We have to import OnInit in order to use like this (actually implementing OnInit is not mandatory but considered good practice):
Read more >
Top 18 Most Common AngularJS Developer Mistakes - Toptal
Common Mistake #1: Accessing The Scope Through The DOM. There are a few optimization tweaks recommended for production. One of them is disabling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found