Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tw93/cz-emoji-chinese
π΄ η«ι
·ηδΈζηζ¬η git commit emoji ππ¨β¨ π₯ππ π ε½δ»€θ‘
https://github.com/tw93/cz-emoji-chinese
git git-emoji github
Last synced: 3 days ago
JSON representation
π΄ η«ι ·ηδΈζηζ¬η git commit emoji ππ¨β¨ π₯ππ π ε½δ»€θ‘
- Host: GitHub
- URL: https://github.com/tw93/cz-emoji-chinese
- Owner: tw93
- License: mit
- Created: 2020-06-11T12:54:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T01:59:42.000Z (over 1 year ago)
- Last Synced: 2024-12-17T11:06:39.225Z (10 days ago)
- Topics: git, git-emoji, github
- Language: JavaScript
- Homepage:
- Size: 132 KB
- Stars: 140
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# cz-emoji-chinese
> δΈζηζ¬η git ζδΊ€ emoji ζη€Ί
**cz-emoji-chinese** allows you to easily use emojis in your commits using [commitizen] with chinese.
![ScreenFlow](https://qpluspicture.oss-cn-beijing.aliyuncs.com/4To9Mo/ScreenFlow.gif)
## Install
**Globally**
```bash
sudo npm i commitizen cz-emoji-chinese -g# Method 1: set as default adapter for your projects
echo '{ "path": "cz-emoji-chinese" }' > ~/.czrc# Method 2: If you want minimalist mode, you can set it like this
echo '{ "path": "cz-emoji-chinese", "config": { "cz-emoji-chinese": { "skipQuestions": [ "issues", "scope","body" ],"subjectMinLength": 1 } } }' > ~/.czrc
```**Locally**
```bash
npm install --save-dev commitizen cz-emoji-chinese
```Add this to your `package.json`:
```json
"config": {
"commitizen": {
"path": "./node_modules/cz-emoji-chinese"
},
}
```## Usage
```sh
$ git cz
```## Customization
By default `cz-emoji-chinese` 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 `cz-emoji-chinese` 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.
```json
{
"config": {
"cz-emoji-chinese": {}
}
}
```### Configuration Options
#### Skip Questions
An array of questions you want to skip:
```json
{
"config": {
"cz-emoji-chinese": {
"skipQuestions": ["scope", "issues"]
}
}
}
```.czrc like this:
```js
{
"path": "cz-emoji-chinese",
"config": {
"cz-emoji-chinese": {
"skipQuestions": [
"issues",
"scope"
]
}
}
}
```You can skip the following questions: `scope`, `body`, and `issues`. The `type` and `subject` questions are mandatory.
#### Types
By default `cz-emoji-chinese` comes preconfigured with the [Gitmoji](https://gitmoji.carloscuesta.me/) types.
An [Inquirer.js] choices array:
```json
{
"config": {
"cz-emoji-chinese": {
"types": [
{
"emoji": "π",
"code": ":star2:",
"description": "A new feature",
"name": "feature"
}
]
}
}
}
```#### Scopes
An [Inquirer.js] choices array:
```json
{
"config": {
"cz-emoji-chinese": {
"scopes": ["home", "accounts", "ci"]
}
}
}
```#### Symbol
A boolean value that allows for an using a unicode value rather than the default of [Gitmoji](https://gitmoji.carloscuesta.me/) markup in a commit message. The default for symbol is false.
```json
{
"config": {
"cz-emoji-chinese": {
"symbol": true
}
}
}
```#### Customize Questions
An object that contains overrides of the original questions:
```json
{
"config": {
"cz-emoji-chinese": {
"questions": {
"body": "This will be displayed instead of original text"
}
}
}
}
```## Examples
- https://github.com/Falieson/TRAM
## Commitlint
Commitlint can be set to work with this package by leveraging the package https://github.com/arvinxx/commitlint-config-gitmoji.
```bash
npm install --save-dev commitlint-config-gitmoji
```_commitlint.config.js_
```js
module.exports = {
extends: ['gitmoji'],
parserPreset: {
parserOpts: {
headerPattern: /^(:\w*:)(?:\s)(?:\((.*?)\))?\s((?:.*(?=\())|.*)(?:\(#(\d*)\))?/,
headerCorrespondence: ['type', 'scope', 'subject', 'ticket']
}
}
}
```## License
MIT Β© Tw93
## Changelog
### 0.3.1
- [+] add `subjectMinLength` for Config