sexy-commits

Sexy commits using gitmoji.dev and inquirer-autocomplete-prompt

Usage no npm install needed!

<script type="module">
  import sexyCommits from 'https://cdn.skypack.dev/sexy-commits';
</script>

README

Logo

Sexy commits using gitmoji.dev and inquirer-autocomplete-prompt


version

Sexy commits using your config from package.json.

Uses gitmoji mapping config from your package.json and inquirer to prompt you for what you did and a brief explanation (used as commit message).

{
  "gitmoji": {
    "build": [
      "🏗️",
      "Make architectural changes"
    ],
    "ci": [
      "👷",
      "Add or update CI build system"
    ],
    "chore": [
      "💄",
      "Boring chores"
    ]
  }
}

-----------------------------------------------------

➤ This is how it works

Add npm script

Add npm script commit that runs sexy-commits.

{
  "scripts": {
    "commit": "sexy-commits"
  }
}

Run the script

npm run commit

Select what you did

image-20210326144343892

Enter a short summary

image-20210326144354677

With arguments

You can also call run sexy-commitswith args.

npm run commit [add] [type] [message]

Where [add] is what do add - either allor a pattern, and [type] is what kind of change you did (depends on your gitmoji config).

Example 1

You did a fix and want to commit all changes:

npm run commit all fix

Example 2

You did a style adjustment and want to commit only what's in the theme folder.

npm run commit style theme "updated dark theme"

Alias support

With v0.3.1we introduces alias support. Add a third element to your gitmoji config which is an array of aliases. Here you can see we mapped build to ci and boringand choresto chore.

{
  "gitmoji": {
    "ci": [
      "👷",
      "Add or update CI build system",
      ["build"]
    ],
    "chore": [
      "💄",
      "Boring chores",
      ["boring", "chores"]
    ]
  }
}

Example 1

You can now do the following:

npm run commit boring "it's so boring to use regular git commits"

Auto push

You can auto push your changes by setting SEXY_COMMITS_AUTO_PUSH to 1 in your .env file.

-----------------------------------------------------

➤ Contributors

Ole Martin Pettersen Carl Joakim Damsleth
Ole Martin Pettersen Carl Joakim Damsleth
olemp@puzzlepart.com carl.joakim.damsleth@puzzlepart.com