forked from Tencent/weui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Tencent#793 from uxsi/dialog
v2.0.1
- Loading branch information
Showing
17 changed files
with
8,448 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea/ | ||
node_modules | ||
npm-debug.log | ||
dist | ||
.DS_Store | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const origin = 'https://github.com/Tencent/weui'; | ||
const comparePath = `${origin}/compare/`; | ||
const commitPath = `${origin}/commit/`; | ||
|
||
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) => { | ||
output += `* ${commit.s}([${commit.h}](${commitPath}${commit.h}))\n`; | ||
}); | ||
|
||
output += '\n'; | ||
}); | ||
|
||
output += '\n\n'; | ||
}); | ||
|
||
return output; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.