Skip to content

Commit 9665859

Browse files
committed
🎨 - code improvement(library): #1
- Adding support for types presets - Adding support for atom type preset version: v1.1.2
1 parent ba20038 commit 9665859

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

β€Ž.gitchangelogβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"scripts",
55
"library",
66
"command"
7-
]
7+
],
8+
"types":"atom"
89
}

β€ŽREADME.mdβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ The commit (`git -m "[commitMessage]"`) template. This template follows the same
8080

8181
##### types
8282

83-
A key-value object with allowed types. The default pairs comes from **karma**. The description is shown when the user type `git changelog --help`.
83+
A key-value object with allowed types. The default pairs comes from **karma**. The description is shown when the user type `git changelog --help`. Can also be a string with that points to a known preset, allowed values are:
84+
85+
- `karma`
86+
- `atom`
8487

8588
-----------------------------
8689

β€Žindex.jsβ€Ž

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ const config = {
2424
changelogFilename:'CHANGELOG.md',
2525
changelogTemplate:'default',
2626
commitTemplate:'karma',
27-
types:{
28-
feat:'new feature for the user, not a new feature for build script',
29-
fix:'bug fix for the user, not a fix to a build script',
30-
docs:'changes to the documentation',
31-
style:'formatting, missing semi colons, etc; no production code change',
32-
refactor:'refactoring production code, eg. renaming a variable',
33-
test:'adding missing tests, refactoring tests; no production code change',
34-
chore:'updating grunt tasks etc; no production code change'
35-
},
27+
types:'karma',
3628
scopes:[],
3729
labels:[
3830
'action',
@@ -47,6 +39,36 @@ try {
4739
Object.assign(config, JSON.parse(localConfig));
4840
} catch (error) {}
4941

42+
if (config.types === 'karma') {
43+
config.types = {
44+
feat: 'new feature for the user, not a new feature for build script',
45+
fix: 'bug fix for the user, not a fix to a build script',
46+
docs: 'changes to the documentation',
47+
style: 'formatting, missing semi colons, etc; no production code change',
48+
refactor: 'refactoring production code, eg. renaming a variable',
49+
test: 'adding missing tests, refactoring tests; no production code change',
50+
chore: 'updating grunt tasks etc; no production code change'
51+
};
52+
} else if (config.types === 'atom') {
53+
config.types = {
54+
'🎨 - code improvement': 'when improving the format/structure of the code',
55+
'🐎 - performance improvement': 'when improving performance',
56+
'🚱 - memory leak': 'when plugging memory leaks',
57+
'πŸ“ - docs': 'when writing docs',
58+
'🐧 - linux fix': 'when fixing something on Linux',
59+
'🍎 - macos fix': 'when fixing something on macOS',
60+
'🏁 - windows fix': 'when fixing something on Windows',
61+
'πŸ› - bug fix': 'when fixing a bug',
62+
'πŸ”₯ - removing code/files': 'when removing code or files',
63+
'πŸ’š - ci build fix': 'when fixing the CI build',
64+
'βœ… - adding tests': 'when adding tests',
65+
'πŸ”’ - security changes': 'when dealing with security',
66+
'⬆️ - upgrading dependencies': 'when upgrading dependencies',
67+
'⬇️ - downgrading dependencies': 'when downgrading dependencies',
68+
'πŸ‘• - linter compliance': 'when removing linter warnings',
69+
};
70+
}
71+
5072
const commitTemplate = loadTemplate(
5173
config.commitTemplate,
5274
__dirname,

0 commit comments

Comments
Β (0)