Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.12k stars 41 forks source link

[Ask For Help] the emojis are not showing in the CLI. #49

Closed tomavic closed 2 years ago

tomavic commented 2 years ago

💭 Describe the feature

I have couple questions:

  "config": {
    "commitizen": {
      "path": "node_modules/cz-git"
    }
  },

Thanks

💡 Proposed Solution

Appreciate all efforts in the documentation but this part needs to be clarified specially the part of czg

Zhengqbbb commented 2 years ago

@tomavic

  • What is diff betn. cz and czg

https://cz-git.qbenben.com/cli/why.html#what-is-different-from-cz-git

I am using normal configs

please copy configfile, config file name and tell me what u using command cz or czg

Zhengqbbb commented 2 years ago

https://user-images.githubusercontent.com/40693636/179258161-e0658ec2-0480-44c3-b8d5-52a4e76be205.mp4

I turn on discussions , if u need help can tell me. I will quick response, after all, I want the badge lol~ 😂

tomavic commented 2 years ago

@tomavic

  • What is diff betn. cz and czg

https://cz-git.qbenben.com/cli/why.html#what-is-different-from-cz-git

  • If u using cz will star commitizen CLI and cz-git adapter(can understand plugin ?)
  • If u using czg will star czg CLI

I am using normal configs

please copy configfile, config file name and tell me what u using command cz or czg

@tomavic

  • What is diff betn. cz and czg

https://cz-git.qbenben.com/cli/why.html#what-is-different-from-cz-git

  • If u using cz will star commitizen CLI and cz-git adapter(can understand plugin ?)
  • If u using czg will star czg CLI

I am using normal configs

please copy configfile, config file name and tell me what u using command cz or czg

First I don't know what is czg 😂 I just used cz. I installed npm i -D cz-git@1.3.9 commitizen@4.2.4

Then I added config file cz.config.js in the root directory

// cz.config.js
/** @type {import('cz-git').CommitizenGitOptions} */
module.exports = {
  alias: { fd: "docs: fix typos" },
  messages: {
    type: "Hey! Select the type of change that you're committing:",
    scope: "Denote the SCOPE of this change (optional):",
    customScope: "Denote the SCOPE of this change:",
    subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
    body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
    breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
    footerPrefixsSelect: "Select the ISSUES type of changeList by this change (optional):",
    customFooterPrefixs: "Input ISSUES prefix:",
    footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
    confirmCommit: "Are you sure you want to proceed with the commit above?"
  },
  types: [
    { value: "feat", name: "feat:     ✨  A new feature", emoji: ":sparkles:" },
    { value: "fix", name: "fix:      🐛  A bug fix", emoji: ":bug:" },
    { value: "docs", name: "docs:     📝  Documentation only changes", emoji: ":memo:" },
    { value: "style", name: "style:    💄  Changes that do not affect the meaning of the code", emoji: ":lipstick:" },
    { value: "refactor", name: "refactor: ♻️   A code change that neither fixes a bug nor adds a feature", emoji: ":recycle:" },
    { value: "perf", name: "perf:     ⚡️  A code change that improves performance", emoji: ":zap:" },
    { value: "test", name: "test:     ✅  Adding missing tests or correcting existing tests", emoji: ":white_check_mark:" },
    { value: "build", name: "build:    📦️   Changes that affect the build system or external dependencies", emoji: ":package:" },
    { value: "ci", name: "ci:       🎡  Changes to our CI configuration files and scripts", emoji: ":ferris_wheel:" },
    { value: "chore", name: "chore:    🔨  Other changes that don't modify src or test files", emoji: ":hammer:" },
    { value: "revert", name: "revert:   ⏪️  Reverts a previous commit", emoji: ":rewind:" }
  ],
  useEmoji: true,
  emojiAlign: "center",
  themeColorCode: "",
  scopes: [],
  allowCustomScopes: true,
  allowEmptyScopes: true,
  customScopesAlign: "bottom",
  customScopesAlias: "custom",
  emptyScopesAlias: "empty",
  upperCaseSubject: false,
  markBreakingChangeMode: false,
  allowBreakingChanges: ['feat', 'fix'],
  breaklineNumber: 100,
  breaklineChar: "|",
  skipQuestions: [],
  issuePrefixs: [{ value: "closed", name: "closed:   ISSUES has been processed" }],
  customIssuePrefixsAlign: "top",
  emptyIssuePrefixsAlias: "skip",
  customIssuePrefixsAlias: "custom",
  allowCustomIssuePrefixs: true,
  allowEmptyIssuePrefixs: true,
  confirmColorize: true,
  maxHeaderLength: Infinity,
  maxSubjectLength: Infinity,
  minSubjectLength: 0,
  scopeOverrides: undefined,
  defaultBody: "",
  defaultIssues: "",
  defaultScope: "",
  defaultSubject: ""
};

Then I added my npm script

    "cm": "git czg"

and when I run npm run cm I got

my-app ➤ npm run cm                                                                git:feat/add-commit-hooks*

> hitchit-admin@0.0.0 cm
> git cz

cz-cli@4.2.4, cz-git@1.3.9

? Hey! Select the type of change that you're committing: Use arrow keys or type to search
❯ feat:     ✨  A new feature 
  fix:      🐛  A bug fix 
  docs:     📝  Documentation only changes 
  style:    💄  Changes that do not affect the meaning of the code 
  refactor: ♻️   A code change that neither fixes a bug nor adds a feature 
  perf:     ⚡️  A code change that improves performance 
  test:     ✅  Adding missing tests or correcting existing tests 

Looks like It's working now LOL xD

I have changed the config file from .cz.config.js to cz.config.js. I believe this is the reason that make it work. Maybe !!

tomavic commented 2 years ago

discussions

2022-07-15.23-39-09.mp4 I turn on discussions , if u need help can tell me. I will quick response, after all, I want the badge lol~ 😂

regarding this format fix(root): :bug: edit configs commitizen The emojis are being displayed as :sparkles:

Could this be changed to display the actual emoji?

Zhengqbbb commented 2 years ago

Could this be changed to display the actual emoji?

Of course, Github supports emoji/unicode directly, But I need to guarantee compatibility because not only GitHub So the default is emoji code

tomavic commented 2 years ago

Could this be changed to display the actual emoji?

Of course, Github supports emoji/unicode directly, But I need to guarantee compatibility because not only GitHub So the default is emoji code

So the "Safest" way to do it is writing it like this way :hammer: :sparkles: and so on?

Zhengqbbb commented 2 years ago

So the "Safest" way to do it is writing it like this way :hammer: :sparkles: and so on?

I admit that it is not intuitive, and in some terminal apps with poor interactivity, emoji/unicode no support that there will be squares in the preview. 😨😱

BTW, I trust u have been seen the configure page

image
tomavic commented 2 years ago

@Zhengqbbb Yes I did. Just wanted to make sure it will not cause any problems with anyone else in my team, specially we are using different OSs

Appreciate your fast response 😂😂 I admit, that was pretty easy configs. Appreciate that 👏

Now I want to generate changelog, how can I do this using semantic release?

That is my next mission to accomplish.

Zhengqbbb commented 2 years ago

Now I want to generate changelog, how can I do this using semantic release?

https://github.com/Zhengqbbb/cz-git/discussions

I admit i want this badge 😂

image
Zhengqbbb commented 2 years ago

I just used cz. I installed npm i -D cz-git@1.3.9 commitizen@4.2.4

BTW 👀👀👀👀

image
tomavic commented 2 years ago

I just used cz. I installed npm i -D cz-git@1.3.9 commitizen@4.2.4

BTW 👀👀👀👀 image

Yeah till now I am still confused what is czg 😂

Zhengqbbb commented 2 years ago

Yeah till now I am still confused what is czg 😂

Let try it:

npm install czg -D
-  "cm": "git czg"
+  "cm": "czg"
npm run cm

If your team use global command cz or git cz will use cz-git plugin If your team use npm run cm will use czg cli

czg more suitable as a dev dependency than commitizen smaller, simpler and lighter