-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.js
More file actions
19 lines (16 loc) · 728 Bytes
/
index.js
File metadata and controls
19 lines (16 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const types = require('conventional-changelog-metahub/types');
const aliases = require('conventional-changelog-metahub/aliases');
const commitizen = require('commitizen');
const _ = require('lodash');
const questions = require('./lib/questions');
const format = require('./lib/format-commit');
const config = _.merge(commitizen.configLoader.load(), {
'cz-conventional-commit': {maxSubjectLength: 72, bodyLineLength: 100, emoji: false},
})['cz-conventional-commit'];
module.exports = {
prompter: async (cz, commit) => {
const answers = await cz.prompt(questions({types: types.types, aliases}, config));
const commitMessage = format(answers, {types: types.types, aliases}, config);
return commit(commitMessage);
},
};