Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
✨ default theme is now gitmoji; old is now original
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeFitz authored and kodiakhq[bot] committed May 1, 2021
1 parent 3e69692 commit b2f560b
Show file tree
Hide file tree
Showing 12 changed files with 1,248 additions and 1,212 deletions.
12 changes: 0 additions & 12 deletions .git-cz.json

This file was deleted.

236 changes: 132 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ I needed to customize some things, and seemed like the intent was breaking away
- [x] Package Upgrades
- [x] Node12 Support
- [x] Subject Customization
- [x] Theming: Gitmoji ✨️
- [x] Theming: Gitmoji ✨️ (new default)
- Semantic Versioning Requirements for CI/CD
- [x] Gitflow Brancing
- CLI Customizations
Expand Down Expand Up @@ -87,71 +87,10 @@ git cz
## Custom config

You can provide a custom configuration in a `changelog.config.js` file in your repo, or in any parent folder.

git-cz will search for the closest config file.
Below is default config:

```js
module.exports = {
disableEmoji: false,
format: '{type}{scope}: {emoji}{subject}',
maxMessageLength: 64,
minMessageLength: 3,
questions: ['type', 'scope', 'subject', 'body', 'breaking', 'issues', 'lerna'],
scopes: [],
types: {
chore: {
description: 'Build process or auxiliary tool changes',
emoji: '🤖',
value: 'chore',
},
ci: {
description: 'CI related changes',
emoji: '🎡',
value: 'ci',
},
docs: {
description: 'Documentation only changes',
emoji: '✏️',
value: 'docs',
},
feat: {
description: 'A new feature',
emoji: '🎸',
value: 'feat',
},
fix: {
description: 'A bug fix',
emoji: '🐛',
value: 'fix',
},
perf: {
description: 'A code change that improves performance',
emoji: '⚡️',
value: 'perf',
},
refactor: {
description: 'A code change that neither fixes a bug or adds a feature',
emoji: '💡',
value: 'refactor',
},
release: {
description: 'Create a release commit',
emoji: '🏹',
value: 'release',
},
style: {
description: 'Markup, white-space, formatting, missing semi-colons...',
emoji: '💄',
value: 'style',
},
test: {
description: 'Adding missing tests',
emoji: '💍',
value: 'test',
},
},
}
```
- [Default Config](https://github.com/JeromeFitz/git-cz/blob/main/lib/themes/default.js))

## Non-interactive mode

Expand All @@ -165,13 +104,13 @@ git-cz --non-interactive --type=feat --subject="add onClick prop to component"

CLI parameters:

- `--type`
- `--subject`
- `--scope`
- `--body`
- `--breaking`
- `--issues`
- `--lerna`
- `--scope`
- `--subject`
- `--type`

## Disable Emoji

Expand Down Expand Up @@ -243,55 +182,116 @@ Have fun in your console if you can't in your codebase. 🤣️

### Theme

`git-cz` provides two themes out of the box: `default` and `gitmoji`.
`git-cz` provides two themes out of the box:

1. `default` (which is `gitmoji`)
2. `original` (which is "old default" from `streamich/git-cz`).

Themes are an opt-in feature. If nothing is provided for `theme` it will fallback to `default`.

📝️ Note: As of 7.x, the opt-in is `default` still but updated to `gitmoji`

#### Default

No customizations needed. These are the emojis you know and love from `git-cz`
[gitmoji](https://gitmoji.dev/)

- 🎸️ feat
- 💡 refactor
- ️ feat
- ♻️ refactor
- etc.

#### Gitmoji
You can `extend` this theme by pulling `./dist/gitmoji/index.json` into your `changelog.config.js` and adding, refactoring as you see fit as well.

A theme for [gitmoji](https://gitmoji.dev/) is available as an **override**.
📝️ Note: `chore` is provided as a `git-cz` fallback for those that enjoy using it. Otherwise all "original" `git-cz` => `default` have a 1:1 map to `gitmoji`.

- ✨️ feat
- ♻️ refactor
📝️ Note: This will override default types along with their emojis.

#### Original

These are the emojis you know and love from `git-cz` available as an **override**.

- 🎸️ feat
- 💡 refactor
- etc.

```bash
--theme gitmoji
--theme original
```

```json
{
"theme": "gitmoji"
"theme": "original"
}
```

You can `extend` this theme by pulling `./dist/gitmoji/index.json` into your `changelog.config.js` and adding, refactoring as you see fit as well.

📝️ Note: `chore` is provided as a `git-cz` fallback for those that enjoy using it. Otherwise all current `git-cz` => `default` have a 1:1 map to `gitmoji`.

📝️ Note: This will override default types along with their emojis.

### Type

Must be one of the following:

- `test` — Adding missing tests
- `feat` — A new feature
- `fix` — A bug fix
- `chore` — Build process or auxiliary tool changes
- `docs` — Documentation only changes
- `refactor` — A code change that neither fixes a bug or adds a feature
- `style` — Markup, white-space, formatting, missing semi-colons...
- `ci` — CI related changes
- `perf` — A code change that improves performance
Default is from `gitmoji`:

- `access`: Improve accessibility
- `analytics`: Add or update analytics or track code
- `animation`: Add or update animations and transitions
- `arch`: Make architectural changes
- `assets`: Add or update assets
- `beer`: Write code drunkenly
- `breaking`: Introduce breaking changes
- `build`: Add or update development scripts
- `catch`: Catch errors
- `chore`: Changes that don’t modify src or test file
- `ci`: Add or update CI build system
- `clean`: Deprecate code that needs to be cleaned up
- `compat`: Update code due to external API changes
- `config`: Add or update configuration files
- `contrib-add`: Add or update contributor(s)
- `data`: Data exploration/inspection
- `db`: Perform database related changes
- `dep-add`: Add a dependency
- `dep-rm`: Remove a dependency
- `dep-up`: Add or update compiled files or packages
- `deploy`: Deploy stuff
- `docs`: Add or update documentation
- `docs-code`: Add or update comments in source code
- `downgrade`: Downgrade dependencies
- `egg`: Add or update an easter egg
- `experiment`: Perform experiments
- `feat`: Introduce new features
- `fix`: Fix a bug
- `fix-ci`: Fix CI Build
- `flags`: Add, update, or remove feature flags
- `hotfix`: Critical hotfix
- `i18n`: Internationalization and localization
- `ignore`: Add or update a .gitignore file
- `init`: Begin a project
- `iphone`: Work on responsive design
- `license`: Add or update license
- `lint`: Fix compiler / linter warnings
- `log-add`: Add or update logs
- `log-rm`: Remove logs
- `merge`: Merge branches
- `mock`: Mock things
- `mv`: Move or rename resources (e.g.: files, paths, routes)
- `patch`: Simple fix for a non-critical issue
- `perf`: Improve performance
- `poo`: Write bad code that needs to be improved
- `prune`: Remove code or files
- `pushpin`: Pin dependencies to specific versions
- `refactor`: Refactor code
- `release`: Release / Version tags
- `revert`: Revert changes
- `rip`: Remove dead code
- `roles`: Work on code related to authorization, roles and permissions
- `security`: Fix security issues
- `seed`: Add or update seed files
- `seo`: Improve SEO
- `snapshot`: Add or update snapshots
- `style`: Improve structure / format of the code
- `test`: Add or update tests
- `texts`: Add or update text and literals
- `types`: Add or update types
- `typo`: Fix typos
- `ui`: Add or update the UI and style files
- `upgrade`: Upgrade dependencies
- `ux`: Improve user experience / usability
- `wip`: Work in progress

### Subject

Expand All @@ -311,7 +311,7 @@ Select the packages the commit affected.

### Breaking Changes

**Breaking Changes** must start with the words `BREAKING CHANGE: `.
**Breaking Changes** must start with the words `BREAKING CHANGE:`.

### Footer

Expand Down Expand Up @@ -348,29 +348,57 @@ git-cz --branch

There are new configs that you can override:

- `branch` ([Config](https://github.com/JeromeFitz/git-cz/blob/main/lib/themes/default.js#L3))
- `branchTypes` ([Config](https://github.com/JeromeFitz/git-cz/blob/main/lib/themes/gitmoji.js#L9))

```js
module.exports = {
branch: {
format: '{branchName}',
projectCode: '',
questions: ['branchName'],
ticketUrl: '',
},
branchTypes: {
feature: {
description: 'A new feature',
emoji: '🎸',
value: 'feature',
code: ':sparkles:',
description: 'Introduce new features.',
emoji: '',
entity: '✨',
gitflow: 'feature',
hidden: false,
name: 'sparkles',
release: 'minor',
section: 'Introduce new features.',
semver: 'minor',
value: 'feat',
},
fix: {
code: ':bug:',
description: 'Fix a bug.',
emoji: '🐛',
entity: '🐛',
gitflow: 'fix',
hidden: false,
name: 'bug',
release: 'patch',
section: 'Fix a bug.',
semver: 'patch',
value: 'fix',
},
hotfix: {
description: 'A hotfix',
code: ':ambulance:',
description: 'Critical hotfix.',
emoji: '🚑️',
entity: '🚑',
gitflow: 'hotfix',
hidden: false,
name: 'ambulance',
release: 'patch',
section: 'Critical hotfix.',
semver: 'patch',
value: 'hotfix',
},
release: {
description: 'A release branch',
emoji: '🏹',
value: 'release',
},
},
format: '{type}{scope}: {emoji}{branchName}{subject}',
}
Expand Down
13 changes: 13 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const branch = {
format: '{branchType}{branchName}',
projectCode: '',
questions: ['branchName', 'branchPrefix', 'branchType'],
ticketUrl: '',
}
const format = '{emoji}{scope} {branchName}{subject}'
const scopes = ['', 'release']
const questions = ['branchPrefix', 'type', 'scope', 'subject', 'body', 'breaking']
const theme = 'default'

// eslint-disable-next-line object-property-newline
module.exports = { branch, format, questions, scopes, theme }
4 changes: 2 additions & 2 deletions lib/createState.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const createState = (config = {}) => {

// @note any overrides should override the theme as base
const configOverride =
Boolean(config) && config.theme === 'gitmoji'
? require('./themes/gitmoji')
Boolean(config) && config.theme === 'original'
? require('./themes/original')
: config

const state = {
Expand Down
4 changes: 2 additions & 2 deletions lib/getConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const getConfig = (root) => {

// @note any overrides should override the theme as base
const theme =
Boolean(overrides) && overrides.theme === 'gitmoji'
? require('./themes/gitmoji')
Boolean(overrides) && overrides.theme === 'original'
? require('./themes/original')
: defaultTheme

const config = {
Expand Down
2 changes: 1 addition & 1 deletion lib/parseArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const helpScreen = `
--disable-emoji don't add emoji to commit title
--format custom formatting options for subject
--non-interactive run git-cz in non-interactive mode
--theme custom them override (default|gitmoji)
--theme custom them override (default|original)
non-interactive mode options:
--body extended description of the commit
Expand Down
Loading

0 comments on commit b2f560b

Please sign in to comment.