You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
755 B
26 lines
755 B
2 years ago
|
'use strict';
|
||
|
|
||
|
const { execSync } = require('child_process');
|
||
|
const fg = require('fast-glob');
|
||
|
|
||
|
const components = fg.sync('*', { cwd: 'components', onlyDirectories: true });
|
||
|
// precomputed scope
|
||
|
const scopeComplete = execSync('git status --porcelain || true')
|
||
|
.toString()
|
||
|
.trim()
|
||
|
.split('\n')
|
||
|
.find(r => ~r.indexOf('M '))
|
||
|
?.replace(/(\/)/g, '%%')
|
||
|
?.match(/components%%((\w|-)*)/)?.[1];
|
||
|
|
||
|
/** @type {import('cz-git').CommitizenGitOptions} */
|
||
|
module.exports = {
|
||
|
scopes: ['site', 'util', 'script', 'tool', ...components],
|
||
|
scopeFilters: ['__tests__', '_util'],
|
||
|
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
|
||
|
defaultScope: scopeComplete,
|
||
|
maxHeaderLength: 100,
|
||
|
allowEmptyIssuePrefixs: false,
|
||
|
allowCustomIssuePrefixs: false,
|
||
|
};
|