1 Star 0 Fork 198

fork类/WeUI

forked from 腾讯开源/WeUI 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.picklogrc.js 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
bearyan 提交于 2019-09-16 16:59 . chore: 优化编译工具
const origin = 'https://github.com/Tencent/weui';
const comparePath = `${origin}/compare/`;
const commitPath = `${origin}/commit/`;
const logs = [];
module.exports = {
filters: [
{
name: 'Features',
regExp: /^(?:feat|add)/i,
},
{
name: 'Bugfixes',
regExp: /^fix/i,
},
{
name: 'Style',
regExp: /^style/i,
},
{
name: 'Performance',
regExp: /^perf/i,
}
],
parse(commits){
// RegExp.prototype.toJSON = RegExp.prototype.toString; // JSON.stringify会调用正则表达式的toJSON
// return JSON.stringify(commits, null, 2); // output commits
let output = '';
commits.forEach((log) => {
let date = new Date(log.timestamp * 1000);
date = `${date.getFullYear()}-${('0' + (date.getMonth() + 1)).substr(-2)}-${('0' + date.getDate()).substr(-2)}`;
let currentTag = log.tag || log.commits[0].h;
let prevTag = log.previousTag || log.commits[log.commits.length - 1].h;
output += `### [${currentTag}](${comparePath}${prevTag || ''}...${currentTag}) (${date})\n\n`;
log.results.forEach((result) => {
output += `#### ${result.filter.name}\n`;
result.commits.forEach((commit) => {
if (logs.indexOf(commit.s) > -1) return;
logs.push(commit.s);
output += `* ${commit.s}([${commit.h}](${commitPath}${commit.h}))\n`;
});
output += '\n';
});
output += '\n\n';
});
return output;
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/fork-class/WeUI.git
[email protected]:fork-class/WeUI.git
fork-class
WeUI
WeUI
master

搜索帮助