-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
143 lines (98 loc) · 2.95 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[[template:logo]] [[template:description]]
[![version](https://img.shields.io/badge/version-[[pkg.version]]-green.svg)](https://semver.org)
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).
```json
{
"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`.
```json
{
"scripts": {
"commit": "sexy-commits"
}
}
```
### Run the script
```shell
npm run commit
```
### Select what you did
![image-20210326144343892](assets/image-20210326144343892.png)
### Enter a short summary
![image-20210326144354677](assets/image-20210326144354677.png)
### With arguments
You can also call run `sexy-commits`with args.
```shell
npm run commit [add] [type] [message]
```
Where **[add]** is what do add - either `all`or 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**:
```shell
npm run commit all fix
```
#### Example 2
You did a **style** adjustment and want to commit only what's in the **theme** folder.
```shell
npm run commit style theme "updated dark theme"
```
### Alias support
With `v0.3.1`we 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 `boring`and `chores`to **chore**.
```json
{
"gitmoji": {
"ci": [
"👷",
"Add or update CI build system",
["build"]
],
"chore": [
"💄",
"Boring chores",
["boring", "chores"]
]
}
}
```
#### Example 1
You can now do the following:
```shell
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.
### Add skip ci tag
If you want to add skip ci tag to your commit, set the `SEXY_COMMITS_SKIP_CI_TAG` variable in your .env file.
#### Example
```Dotenv
SEXY_COMMITS_SKIP_CI_TAG=[skip-ci]
```
### Lint your changes before commiting
By specifying `SEXY_COMMITS_LINT_CMD` in your .env file, we can lint your changes before commiting (e.g. with [ESLint](https://eslint.org/)).
#### Example
```Dotenv
SEXY_COMMITS_LINT_CMD=npm run-script lint
```
[[template:contributors]]
### Working with issues
You can automatically tag and/or close issues automatically when commiting with `sexy-commits`.
By specifying `SEXY_COMMITS_ISSUE_REF` in your .env file, the commit will automatically tag the issue. Do not specify the issue number with the #.
By also providing `SEXY_COMMITS_FIXES_ISSUE`, the issue will automatically be closed when commiting.