npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

comigoji-changelog

v1.0.0

Published

Generates a nice changelog from gitmoji/comigoji commit history of several repositories at once.

Downloads

3

Readme

Not fully tested, but should work.

Comigoji Changelog

This CLI app is designed to generate changelogs for one or more repos at once. By default, repos should convey to Comigoji commit message guidelines, and can use both Vanilla and Gitmoji-like flavors out-of-the-box. This can be configured, though, and be applicable to other commit message guidelines as long as they have distinct prefixes in their subjects.

Usage

// yourProject/comigojiChangelog.js
// Can also be a static .json file

const since = new Date('2019-09-25T10:15:11+12:00');
module.exports = {
    repos: [{
        since,
        repo: './repo1',
        branch: 'develop'
    }, {
        since,
        repo: '/home/user/repo2',
        branch: 'master'
    }]
};
npm install -g comigoji-changelog
comigoji-changelog ./comigojiChangelog.js > Changelog.md

Note that this changelog tool does not choose by itself the point from which to write the changelog. If since parameter is not specified for each repo, then it will fetch all the commits in these repositories. As you can use a .js file as an input, you can perform any computations before generating a changelog, be they synchronous or not. An example that gets a latest tag's date from one repository and applies it to other ones:

// yourProject/comigojiChangelog.js
// This gets a datetime string of the latest tagged commit
const gitCommand = 'git log --max-count=1 --tags --simplify-by-decoration --pretty="format:%cI"';
const {exec} = require('child_process');

module.exports = new Promise((resolve, reject) => {
    // assuming that the current working directory is a git repo with relevant tags
    exec(gitCommand, function (err, stdout, stderr) {
        if (err) {
            reject(err);
            return;
        }
        if (stderr) {
            reject(new Error(stderr));
            return;
        }
        const since = new Date(stdout.trim());
        resolve({
            repos: [{
                since,
                repo: './',
                branch: 'develop'
            }, {
                since,
                repo: '/home/user/repo2',
                branch: 'master'
            }]
        });
    });
});

Defining your own categories

module.exports = {
    repos: [/* … */],
    categories: {
        // generic categories
        feature: {
            // should be a regexp or a string
            pattern: /^:(rainbow|sparkles):/,
            header: '### ✨ New Features'
        },
        improvement: {
            pattern: /^:(zap|wrench):/,
            header: '### ⚡️ General Improvements'
        },
        bug: {
            pattern: /^:bug:/,
            header: '### 🐛 Bug Fixes'
        },
        /* … */
        default: {
            // If you want strangely named commits to appear in the changelog, this section (`default`) should be present
            header: `### 👽 Misc`
        },
        ignore: {
            pattern: /^:(construction|doughnut|rocket|bookmark):/,
            skip: true // this makes specific commits to be ignored
        }
    }
};

Autocategories for doc sites, website updates, etc.

Certain repos may be configured so that their commits are automatically put into specific categories.

module.exports = {
    repos: [{
        repo: './docs',
        branch: 'master',
        forceCategory: 'docs',
        // Doc commits usually contain the 📝 symbol, which is already used in a header.
        // The line below will clean up these symbols.
        forceCategoryStrip: /^:(books|pencil|pencil2|memo):/
    }, {
        repo: './website',
        branch: 'master',
        // this repo's commit subjects will be written as is
        forceCategory: 'website'
    }],
    categories: {
        /* … */
        docs: {
            pattern: /^:(books|pencil|pencil2|memo):/,
            header: '### 📝 Docs'
        },
        website: {
            header: '### 🌐 Website'
        }
    }
};