-
Notifications
You must be signed in to change notification settings - Fork 7
/
templates.ts
202 lines (182 loc) · 7.58 KB
/
templates.ts
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
export namespace Templates {
export const title = `<%= timespan.name %> Report (<%= fromDate %> - <%= toDate %>)`
export const header = `Here's the **<%= timespan.name %> Report** for [*<%= owner %>/ <%= repo %>*](https://github.com/<%= owner %>/<%= repo %>):\n`
export const footer =
'\n - - - \n' +
'\n' +
`That's all for last <%= timespan.unit %>, please <kbd>:eyes: **Watch**</kbd> and <kbd>:star: **Star**</kbd> the repository [*<%= owner %>/<%= repo %>*](https://github.com/<%= owner %>/<%= repo %>) to receive next reports. :smiley:\n\n` +
`
<% if(labels.length) { %>
*You can also [view all <%= timespan.name %> Reports by clicking here](https://github.com/<%= owner %>/<%= repo %>/issues?q=is:open+is:issue+label:<%= labels[0] %>).* \n\n
<% } %>
`
// ISSUES
// ------
export const issuesTitle = '# ISSUES'
export const issuesSummary = `
<% if (issues.length === 0) { %>
Last <%= timespan.unit %>, no issues were created.
<% } else if (issues.length === 1) { %>
Last <%= timespan.unit %> 1 issue was created.
<% } else { %>
Last <%= timespan.unit %> <%= issues.length %> issues were created.
<% } %>
`
export const issuesStatistics = `
<% if (issues.length === 1 && openIssues.length === 1) { %>
It is still open.
<% } else if (issues.length === openIssues.length && openIssues.length > 1) { %>
They are still open.
<% } else if (issues.length === 1 && closedIssues.length === 1) { %>
It is closed now.
<% } else if (issues.length === closedIssues.length && closedIssues.length > 1) { %>
They are all have been closed.
<% } else if (issues.length > 0) { %>
Of these,
<% if (closedIssues.length > 0) { %>
<% if (closedIssues.length === 1) { %>
<%= closedIssues.length %> issue has been closed
<% } else { %>
<%= closedIssues.length %> issues have been closed
<% } %>
<% if (openIssues.length > 0) { %>
and
<% } %>
<% } %>
<% if (openIssues.length > 0) { %>
<% if (openIssues.length === 1) { %>
<%= openIssues.length %> issue is still open
<% } else { %>
<%= openIssues.length %> issues are still open
<% } %>
<% } %>
.
<% } %>
`
export const openIssuesTitle = '## OPEN ISSUES'
export const openIssuesItem = `:green_heart: #<%= issue.number %> <%= issueLink %> by <%= userLink%>`
export const closedIssuesTitle = '## CLOSED ISSUES'
export const closedIssuesItem = `:heart: #<%= issue.number %> <%= issueLink %> by <%= userLink%>`
export const likedIssuesTitle = `
<% if (likedIssues.length > 1) { %>
## TOP <%= likedIssues.length %> LIKED ISSUES
<% } else { %>
## MOST LIKED ISSUE
<% } %>
`
export const likedIssuesReaction = `
<% var result = [] %>
<% if (reactions['+1'] > 0) { %>
<% result.push(':+1: x' + reactions['+1']) %>
<% } if(reactions.laugh > 0) { %>
<% result.push(':smile: x' + reactions.laugh) %>
<% } if(reactions.hooray > 0) { %>
<% result.push(':tada: x' + reactions.hooray) %>
<% } if(reactions.heart > 0) { %>
<% result.push(':heart: x' + reactions.heart) %>
<% } if(reactions.rocket > 0) { %>
<% result.push(':rocket: x' + reactions.rocket) %>
<% }%>
<%= result.join(', ') %>
`
export const likedIssuesItem = `:+1: #<%= issue.number %> <%= issueLink %> by <%= userLink%>, received <%= reactions %>.`
export const hotIssuesTitle = `
<% if (hotIssues.length > 1) { %>
## TOP <%= hotIssues.length %> HOT ISSUES
<% } else { %>
## MOST HOTT ISSUE
<% } %>
`
export const hotIssuesItem = `:speaker: #<%= issue.number %> <%= issueLink %> by <%= userLink%>, received <%= issue.comments %> comments.`
// PULL REQUESTS
// -------------
export const pullRequestsTitle = '# PULL REQUESTS'
export const pullRequestsSummary = `
<% if (pullRequests.length === 0) { %>
Last <%= timespan.unit %>, no pull requests were created, updated or merged.
<% } else if (pullRequests.length === 1) { %>
Last <%= timespan.unit %> 1 pull request was created, updated or merged.
<% } else { %>
Last <%= timespan.unit %> <%= pullRequests.length %> pull requests were created, updated or merged.
<% } %>
`
export const openPullRequestsTitle = `## OPEN PULL REQUEST`
export const openPullRequestsSummary = `
<% if (openPullRequests.length === 1) { %>
Last <%= timespan.unit %>, 1 pull request was opened.
<% } else { %>
Last <%= timespan.unit %>, <%= openPullRequests.length %> pull requests were opened.
<% } %>
`
export const openPullRequestsItem = `:green_heart: #<%= pullRequest.number %> <%= pullRequestLink %> by <%= userLink%>`
export const updatedPullRequestsTitle = `## UPDATED PULL REQUEST`
export const updatedPullRequestsSummary = `
<% if (updatedPullRequests.length === 1) { %>
Last <%= timespan.unit %>, 1 pull request was updated.
<% } else { %>
Last <%= timespan.unit %>, <%= updatedPullRequests.length %> pull requests were updated.
<% } %>
`
export const updatedPullRequestsItem = `:yellow_heart: #<%= pullRequest.number %> <%= pullRequestLink %> by <%= userLink%>`
export const mergedPullRequestsTitle = `## MERGED PULL REQUEST`
export const mergedPullRequestsSummary = `
<% if (mergedPullRequests.length === 1) { %>
Last <%= timespan.unit %>, 1 pull request was merged.
<% } else { %>
Last <%= timespan.unit %>, <%= mergedPullRequests.length %> pull requests were merged.
<% } %>
`
export const mergedPullRequestsItem = `:purple_heart: #<%= pullRequest.number %> <%= pullRequestLink %> by <%= userLink%>`
// COMMITS
// -------
export const commitsTitle = `# COMMITS`
export const commitsSummary = `
<% if (commits.length === 0) { %>
Last <%= timespan.unit %> there were no commits.
<% } else if (commits.length === 1) { %>
Last <%= timespan.unit %> there was 1 commit.
<% } else { %>
Last <%= timespan.unit %> there were <%= commits.length %> commits.
<% } %>
`
export const commitsItem = `:hammer_and_wrench: <%= commitLink %> by <%= userLink%>`
// CONTRIBUTORS
// ------------
export const contributorsTitle = `# CONTRIBUTORS`
export const contributorsSummary = `
<% if (contributors.length === 0) { %>
Last <%= timespan.unit %> there were no contributors.
<% } else if (contributors.length === 1) { %>
Last <%= timespan.unit %> there was 1 contributor.
<% } else { %>
Last <%= timespan.unit %> there were <%= contributors.length %> contributors.
<% } %>
`
export const contributorsItem = `:bust_in_silhouette: <%= userLink%>`
// STARGAZERS
// ----------
export const stargazersTitle = `# STARGAZERS`
export const stargazersSummary = `
<% if (stargazers.length === 0) { %>
Last <%= timespan.unit %> there were no stargazers.
<% } else if (stargazers.length === 1) { %>
You are the star! :star2:
<% } else { %>
You all are the stars! :star2:
<% } %>
`
export const stargazersItem = `:star: <%= userLink%>`
// RELEASES
// --------
export const releasesTitle = `# RELEASES`
export const releasesSummary = `
<% if (releases.length === 0) { %>
Last <%= timespan.unit %> there were no releases.
<% } else if (releases.length === 1) { %>
Last <%= timespan.unit %> there was 1 release.
<% } else { %>
Last <%= timespan.unit %> there were <%= releases.length %> releases.
<% } %>
`
export const releasesItem = `:rocket: [<%= releaseName %>](<%= release.html_url %>)`
}