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

@paalan/cz-emoji

v0.1.0

Published

A commitizen adapter for the commitizen cli that uses emojis for commiting. ๐ŸŽ‰

Downloads

10

Readme

@paalan/cz-emoji

Commitizen adapter formatting commit messages using emojis.

@paalan/cz-emoji allows you to easily use emojis in your commits using commitizen.

? Select the type of change you are committing: (Use arrow keys)
โฏ feature   ๐ŸŒŸ  A new feature
  fix       ๐Ÿž  A bug fix
  docs      ๐Ÿ“š  Documentation change
  refactor  ๐ŸŽจ  A code refactoring change
  chore     ๐Ÿ”ฉ  A chore change

Install

Globally

npm install --global @paalan/cz-emoji

# set as default adapter for your projects
echo '{ "path": "@paalan/cz-emoji" }' > ~/.czrc

Locally

npm install --save-dev @paalan/cz-emoji

Add this to your package.json:

"config": {
  "commitizen": {
    "path": "@paalan/cz-emoji"
  }
}

Usage

$ git cz

Customization

By default @paalan/cz-emoji comes ready to run out of the box. Uses may vary, so there are a few configuration options to allow fine tuning for project needs.

How to

Configuring @paalan/cz-emoji can be handled in the users home directory (~/.czrc) for changes to impact all projects or on a per project basis (package.json). Simply add the config property as shown below to the existing object in either of the locations with your settings for override.

{
  "config": {
    "@paalan/cz-emoji": {}
  }
}

Configuration Options

Types

By default @paalan/cz-emoji comes preconfigured with the Gitmoji types.

An Inquirer.js choices array:

{
  "config": {
    "@paalan/cz-emoji": {
      "types": [
        {
          "emoji": "๐ŸŒŸ",
          "code": ":star2:",
          "description": "A new feature",
          "name": "feature"
        }
      ]
    }
  }
}

Scopes

An Inquirer.js choices array:

{
  "config": {
    "@paalan/cz-emoji": {
      "scopes": ["home", "accounts", "ci"]
    }
  }
}

Emoji Symbol

A boolean value that allows for an using a unicode value rather than the default of Gitmoji markup in a commit message. The default for emojiSymbol is false.

{
  "config": {
    "@paalan/cz-emoji": {
      "emojiSymbol": true
    }
  }
}

Skip Questions

An array of questions you want to skip:

{
  "config": {
    "@paalan/cz-emoji": {
      "skipQuestions": ["scope", "issues"]
    }
  }
}

You can skip the following questions: scope, body, issues, and breaking. The type and subject questions are mandatory.

Customize Questions

An object that contains overrides of the original questions:

{
  "config": {
    "@paalan/cz-emoji": {
      "questions": {
        "body": "This will be displayed instead of original text"
      }
    }
  }
}

Customize the subject max length

The maximum length you want your subject has

{
  "config": {
    "@paalan/cz-emoji": {
      "subjectMaxLength": 200
    }
  }
}

Examples

  • https://github.com/paalamugan/media-video-downloader

Commitlint

Commitlint can be set to work with this package with the following configuration:

commitlint.config.js

const pkg = require('./package.json');

// Check if the user has configured the package to use conventional commits.
const isConventional = pkg.config
  ? pkg.config['@paalan/cz-emoji']?.conventional
  : false;

// Regex for default and conventional commits.
const RE_DEFAULT_COMMIT =
  /^(?::.*:|(?:\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))\s(?<emoji>\((?<scope>.*)\)\s)?.*$/gm;
const RE_CONVENTIONAL_COMMIT =
  /^^(?<type>\w+)(?:\((?<scope>\w+)\))?\s(?<emoji>:.*:|(?:\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]))\s.*$/gm;

module.exports = {
  rules: {
    '@paalan/cz-emoji': [2, 'always'],
  },
  plugins: [
    {
      rules: {
        '@paalan/cz-emoji': ({ raw }) => {
          const isValid = isConventional
            ? RE_CONVENTIONAL_COMMIT.test(raw)
            : RE_DEFAULT_COMMIT.test(raw);

          const message = isConventional
            ? `Your commit message should follow conventional commit format.`
            : `Your commit message should be: <emoji> (<scope>)?: <subject>`;

          return [isValid, message];
        },
      },
    },
  ],
};

Let me know if you are interested in having the above configuration published as a commitlint plugin.

License

MIT ยฉ Paalamugan