-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.cz-config.js
51 lines (47 loc) · 1.84 KB
/
.cz-config.js
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
const glob = require('glob');
/**
* @param {string} pattern
* @param {Function} [fn]
*/
const globMap = (pattern, fn) =>
glob
.sync(pattern)
.map(fn || (path => path))
.map(path => path.replace(/\/$/, ''));
/**
* Check `path` to not include substring in `variants`
* @param {string[]} variants
* @return {function(*): *}
*/
const exclude = variants => path => variants.every(variant => !path.includes(variant));
module.exports = {
types: [
{ value: 'feat', name: '🎸 feat: A new feature' },
{ value: 'fix', name: '🐛 fix: A bug fix' },
{ value: 'refactor', name: '💡 refactor: A code change that neither fixes a bug or adds a feature' },
{ value: 'style', name: '💄 style: Markup, white-space, formatting, missing semi-colons...' },
{ value: 'test', name: '💍 test: Adding missing tests' },
{ value: 'chore', name: '🤖 chore: Build process or auxiliary tool changes' },
{ value: 'wip', name: '🕯 wip: Work in progress' },
{ value: 'docs', name: '✏️ docs: Documentation only changes' },
{ value: 'revert', name: '🐰 revert: Revert to a commit' },
{ value: 'perf', name: '💪 perf: A code change that improves performance"' }
],
allowCustomScopes: true,
skipQuestions: ['footer'],
allowBreakingChanges: ['fix', 'feat', 'revert', 'refactor'],
scopes: [].concat(
'client',
globMap('src/client/*/', path => path.replace(/src\//, '')),
'core',
globMap('src/core/*/', path => path.replace(/src\//, '')).filter(exclude(['core/features', 'core/ui'])),
'core/features',
globMap('src/core/features/*/', path => path.replace(/src\//, '')),
'core/ui',
globMap('src/core/ui/*/', path => path.replace(/src\//, '')),
'server',
globMap('src/server/*/', path => path.replace(/src\//, '')),
'types',
globMap('types/*/')
)
};