Giter Site home page Giter Site logo

folke / devmoji Goto Github PK

View Code? Open in Web Editor NEW
295.0 295.0 21.0 3.79 MB

:robot: :rocket: :sparkles: Emojify your conventional commits with Devmoji

Home Page: https://www.npmjs.com/package/devmoji

License: Apache License 2.0

JavaScript 4.09% TypeScript 95.85% Shell 0.06%
cli commit commit-message conventional-changelog conventional-commits emoji gitmoji

devmoji's Issues

devmoji for bots

Hi. I do really like this project and already integrated is as a git hook for my personal usage. However, I would like to go further and make all the commits in repo be processed by devmoji. There are many commits, which comes from automated tools (e.g. renovate-bot, snyk, etc) in my repos. Is there any recipe to make those tools also use devmoji? Or can I somehow post-process commits from bots by devmoji?

`i18n` type doesn't work

When committing with i18n as the type, no emoji is added. It doesn't work even if manually added to the config:

{ code: 'i18n', gitmoji: 'globe_with_meridians' }

If that gitmoji is added to something else, it works, e.g.:

{ code: 'build', gitmoji: 'globe_with_meridians' },

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

[compat] Vim Fugitive won't work with pre-commit-msg hook

I had an issue where the vim-fugitive wasn't working with the prepare-commit-msg hook. Simply changing to the commmit-msg hook in my Husky config got things working as they used to—it caught bad commit messages.

Am I missing anything by using the commit-msg hook instead of prepare-commit-msg? If not, it might be worth mentioning that the commit-msg hook can be used as well. 🧠

Support for second variant of BREAKING CHANGE

You support one variant of breaking change signature: type(scope)!: description

It would be great if you could support also second variant of breaking change signature:

type(scope): description

BREAKING CHANGE: description of breaking change

We could use this type of regex: ($\s$\sBREAKING CHANGE)

Bug: doesn't work, if scope has spaces

echo "perf(account summary): improve rendering time" | devmoji --commit

Current:

perf(account summary): improve rendering time

Expected:

perf(account summary): ⚡️ improve rendering time

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency rollup-plugin-terser with @rollup/plugin-terser 0.1.0
  • chore(deps): update dependency @rollup/plugin-commonjs to v25
  • chore(deps): update dependency @rollup/plugin-node-resolve to v15
  • chore(deps): update dependency @rollup/plugin-typescript to v11
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency concurrently to v8
  • chore(deps): update dependency conventional-changelog-conventionalcommits to v8
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency rollup to v4
  • chore(deps): update dependency typescript to v5
  • chore(deps): update github/codeql-action action to v3
  • fix(deps): update dependency commander to v12
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
.github/workflows/codeql-analysis.yml
  • actions/checkout v2
  • github/codeql-action v1
  • github/codeql-action v1
  • github/codeql-action v1
npm
package.json
  • chalk ^4.1.1
  • commander 7.2.0
  • ts-interface-checker 1.0.2
  • @rollup/plugin-commonjs 19.0.2
  • @rollup/plugin-node-resolve 13.0.6
  • @rollup/plugin-typescript 8.2.5
  • @semantic-release/changelog 5.0.1
  • @semantic-release/git 9.0.1
  • @types/jest 26.0.24
  • @types/node 15.12.2
  • @types/node-fetch 2.5.12
  • @typescript-eslint/eslint-plugin 4.27.0
  • @typescript-eslint/parser 4.27.0
  • concurrently 6.2.2
  • conventional-changelog-conventionalcommits 4.6.3
  • copyfiles 2.4.1
  • eslint 7.28.0
  • eslint-config-prettier 8.3.0
  • eslint-plugin-import 2.23.4
  • eslint-plugin-jest 24.3.7
  • eslint-plugin-prettier 3.4.1
  • husky 6.0.0
  • jest 27.0.6
  • node-fetch 2.6.7
  • prettier 2.3.2
  • rimraf 3.0.2
  • rollup 2.52.8
  • rollup-plugin-progress 1.1.2
  • rollup-plugin-sizes 1.0.6
  • rollup-plugin-terser 7.0.2
  • semantic-release 17.4.7
  • ts-interface-builder 0.3.3
  • ts-jest 27.0.7
  • ts-node 10.0.0
  • typescript 4.3.5
  • minimist ^1.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

[Question] Devmoji and Commitizen

Hi. This project is cool. I'm wondering how can I add it to my project.

Devmoji and Commitizen

Currently, I have a husky hook which looks like this...:

  "husky": {
    "hooks": {
      "prepare-commit-msg": "yarn run prepare-commit-msg"
    }
  },

Inside, prepare-commit-msg runs commitizen exec < /dev/tty && git cz --hook || true.
Does you think it's ok to use both? How would you use devmoji in this situation?

Devmoji logs

I would also like to add that when I add devmoji as a dev dependency yarn add --dev devmoji and try to run its logs with yarn devmoji --log it exits with an error error Command failed with exit code 1.. Is this expected behaviour?

Adds TypeScript support for configuration file

Description

Hello, I love adding emojis to my commits and recently I found this repository to be a good tool to automate this process to me and also other devs of projects I work on. The thing is, I like TypeScript and have a tendency of not allowing any .js files in projects I work with. The fact this project only supported configuration file in .js format kind of bothered me a little, so I decided to add typescript support for the configuration file devmoji.config.ts.
The PR is here: #220

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I ran all the test suits with both yarn test and yarn test:cov and provided a new test to the new typescript configuration file.

  • load typescript from config file

image

(Also tried to improve coverage a bit by adding a test for a uncovered scenario config file does not exist).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

[suggestion] to add doc about git hook which would not depend upon 3-rd party tool

Hi. In my project we do use conventional commits, but we don't use husky or Yorkie, also we don't want to force people to use emojis in commits. However, personally, I like putting emojis into my commits and I want it to be automated. Therefore, I've added devmoji into my .git/hooks/ manually. Here is info on how I have this done. In the root of project, run:

cp .git/hooks/prepare-commit-msg.sample .git/hooks/prepare-commit-msg # note, it's important to copy this to make sure file is executable
echo "#\!/bin/sh\n\nCOMMIT_MSG_FILE=\$1\nCOMMIT_MSG=\$(cat \$COMMIT_MSG_FILE)\n\necho \"\${COMMIT_MSG}\" | devmoji > \$1" > .git/hooks/prepare-commit-msg

Would be great to have this added to the README of the project. Thanks!


The resulting content of .git/hooks/prepare-commit-msg would be:

#!/bin/sh

COMMIT_MSG_FILE=$1
COMMIT_MSG=$(cat $COMMIT_MSG_FILE)

echo "${COMMIT_MSG}" | devmoji > $1

devmoji type(scope) not blue when using `--log` option

I'm using the git log command from the docs and the output is the same, sans the blue text for the type(scope) part. Any idea why it might not work when passing it through git log?

Just to test, I ran these commands…

echo "testing feat: ✨ cool stuff" | devmoji # => no coloring
echo "feat: ✨ cool stuff" | devmoji # => HAS coloring
echo "feat: cool stuff" | devmoji --log # => no coloring

adding a unicode emoji

awesome library!

wanted to change the emoji for test from 🚨 to 🧪 but the docs don't make it entirely clear on how to do that in devmoji.config.js.

This config:

module.exports = {
  types: ["lint"],
  devmoji: [{ code: "test", emoji: "🧪" }],
};

with this command:

echo "test: add middleware tests" | devmoji --format unicode 

yields:

test: :🧪: add middleware tests

Just wondering if there's a way to map normal unicode emojis in the config?

Edit: the GitHub alias is :test_tube: - I wonder whether this is just not added to the source?

Question about emoji linting

Is there any way or do you know some tool that can lint commits to ensure that they have emojis in them? I know commitlint exist and that you can implement that in a CI environment, but is there something that can validate not just conventional commits but with emojis placed between type(scope): and the description...?

Adding WIP Commits

Enjoy library and the constraints it creates when coupled with a precommit hook. One thing is bothering me though and that's how to check-in WIP code. What I'd like to be able to do is this:

git commit -m "wip: experimental prototype"

And see something like this in the git log:

wip: 🚧 experimental prototype

And this will be allowed by the tool and, optionally, prevented from hitting the remote using another git commit hook. Is that possible via config right now? If not, can it be added? Without it users are more likely to lose their work via stashing or miscategorize their work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.