Skip to content

Commit 084dfc2

Browse files
committed
Merge remote-tracking branch 'origin/canary' into fix-babel-with-next-image
2 parents 085d5a6 + 2ca8d3d commit 084dfc2

File tree

613 files changed

+51243
-105907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

613 files changed

+51243
-105907
lines changed

.github/actions/next-repo-info/dist/issues/index.mjs

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

.github/actions/next-repo-info/dist/issues/licenses.txt

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,30 @@ MIT
249249

250250
@slack/web-api
251251
MIT
252+
MIT License
253+
254+
Copyright (c) 2014- Slack Technologies, LLC
255+
256+
Permission is hereby granted, free of charge, to any person obtaining
257+
a copy of this software and associated documentation files (the
258+
"Software"), to deal in the Software without restriction, including
259+
without limitation the rights to use, copy, modify, merge, publish,
260+
distribute, sublicense, and/or sell copies of the Software, and to
261+
permit persons to whom the Software is furnished to do so, subject to
262+
the following conditions:
263+
264+
The above copyright notice and this permission notice shall be
265+
included in all copies or substantial portions of the Software.
266+
267+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
268+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
269+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
270+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
271+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
272+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
273+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
274+
275+
252276

253277
@vercel/ncc
254278
MIT
@@ -663,27 +687,15 @@ SOFTWARE.
663687

664688
is-stream
665689
MIT
666-
The MIT License (MIT)
690+
MIT License
667691

668-
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
692+
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
669693

670-
Permission is hereby granted, free of charge, to any person obtaining a copy
671-
of this software and associated documentation files (the "Software"), to deal
672-
in the Software without restriction, including without limitation the rights
673-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
674-
copies of the Software, and to permit persons to whom the Software is
675-
furnished to do so, subject to the following conditions:
694+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
676695

677-
The above copyright notice and this permission notice shall be included in
678-
all copies or substantial portions of the Software.
696+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
679697

680-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
681-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
682-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
683-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
684-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
685-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
686-
THE SOFTWARE.
698+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
687699

688700

689701
mime-db

.github/actions/next-repo-info/dist/prs/index.mjs

Lines changed: 17 additions & 0 deletions
Large diffs are not rendered by default.

.github/actions/next-repo-info/dist/prs/licenses.txt

Lines changed: 1001 additions & 0 deletions
Large diffs are not rendered by default.

.github/actions/next-repo-info/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"private": true,
33
"description": "Notify Next.js team about pending PRs and popular issues",
44
"scripts": {
5-
"build-issues": "ncc build src/popular-issues.mjs -m -o dist/issues --license licenses.txt"
5+
"build": "pnpm build-issues && pnpm build-prs",
6+
"build-issues": "ncc build src/popular-issues.mjs -m -o dist/issues --license licenses.txt",
7+
"build-prs": "ncc build src/popular-prs.mjs -m -o dist/prs --license licenses.txt"
68
},
79
"dependencies": {
810
"@actions/core": "^1.10.1",
911
"@actions/github": "6.0.0",
10-
"@slack/web-api": "^6.11.2"
12+
"@slack/web-api": "^7.0.1"
1113
},
1214
"devDependencies": {
1315
"@vercel/ncc": "^0.38.1"

.github/actions/next-repo-info/src/popular-issues.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ import { context, getOctokit } from '@actions/github'
33
import { setFailed, info } from '@actions/core'
44
import { WebClient } from '@slack/web-api'
55

6-
// Get the date 90 days ago (YYYY-MM-DD)
7-
function getNinetyDaysAgoDate() {
8-
const date = new Date()
9-
date.setDate(date.getDate() - 90)
10-
return date.toISOString().split('T')[0]
11-
}
12-
136
function generateBlocks(issues) {
147
const blocks = [
158
{
@@ -23,19 +16,22 @@ function generateBlocks(issues) {
2316
type: 'divider',
2417
},
2518
]
19+
2620
let text = ''
2721
issues.forEach((issue, i) => {
2822
text += `${i + 1}. [<${issue.html_url}|#${issue.number}>, :+1: ${
2923
issue.reactions['+1']
3024
}]: ${issue.title}\n`
3125
})
26+
3227
blocks.push({
3328
type: 'section',
3429
text: {
3530
type: 'mrkdwn',
3631
text: text,
3732
},
3833
})
34+
3935
return blocks
4036
}
4137

@@ -47,7 +43,11 @@ async function run() {
4743
const octoClient = getOctokit(process.env.GITHUB_TOKEN)
4844
const slackClient = new WebClient(process.env.SLACK_TOKEN)
4945

50-
const ninetyDaysAgo = getNinetyDaysAgoDate()
46+
// Get the date 90 days ago (YYYY-MM-DD)
47+
const date = new Date()
48+
date.setDate(date.getDate() - 90)
49+
const ninetyDaysAgo = date.toISOString().split('T')[0]
50+
5151
const { owner, repo } = context.repo
5252
const { data } = await octoClient.rest.search.issuesAndPullRequests({
5353
order: 'desc',
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// @ts-check
2+
import { context, getOctokit } from '@actions/github'
3+
import { setFailed, info } from '@actions/core'
4+
import { WebClient } from '@slack/web-api'
5+
6+
function generateBlocks(prs) {
7+
const blocks = [
8+
{
9+
type: 'section',
10+
text: {
11+
type: 'mrkdwn',
12+
text: '*A list of the top 15 PRs sorted by most :+1: reactions over the last 90 days.*\n_Note: This :github2: workflow will run every Monday at 1PM UTC (9AM EST)._',
13+
},
14+
},
15+
{
16+
type: 'divider',
17+
},
18+
]
19+
20+
let text = ''
21+
prs.forEach((pr, i) => {
22+
text += `${i + 1}. [<${pr.html_url}|#${pr.number}>, :+1: ${
23+
pr.reactions['+1']
24+
}]: ${pr.title}\n`
25+
})
26+
27+
blocks.push({
28+
type: 'section',
29+
text: {
30+
type: 'mrkdwn',
31+
text: text,
32+
},
33+
})
34+
35+
return blocks
36+
}
37+
38+
async function run() {
39+
try {
40+
if (!process.env.GITHUB_TOKEN) throw new TypeError('GITHUB_TOKEN not set')
41+
if (!process.env.SLACK_TOKEN) throw new TypeError('SLACK_TOKEN not set')
42+
43+
const octoClient = getOctokit(process.env.GITHUB_TOKEN)
44+
const slackClient = new WebClient(process.env.SLACK_TOKEN)
45+
46+
// Get the date 90 days ago (YYYY-MM-DD)
47+
const date = new Date()
48+
date.setDate(date.getDate() - 90)
49+
const ninetyDaysAgo = date.toISOString().split('T')[0]
50+
51+
const { owner, repo } = context.repo
52+
const { data } = await octoClient.rest.search.issuesAndPullRequests({
53+
order: 'desc',
54+
per_page: 15,
55+
q: `repo:${owner}/${repo} is:pr is:open created:>=${ninetyDaysAgo}`,
56+
sort: 'reactions-+1',
57+
})
58+
59+
if (data.items.length > 0) {
60+
await slackClient.chat.postMessage({
61+
blocks: generateBlocks(data.items),
62+
channel: '#team-next-js',
63+
icon_emoji: ':github:',
64+
username: 'GitHub Notifier',
65+
})
66+
67+
info(`Posted to Slack!`)
68+
} else {
69+
info(`No popular PRs`)
70+
}
71+
} catch (error) {
72+
setFailed(error)
73+
}
74+
}
75+
76+
run()

.github/pnpm-lock.yaml

Lines changed: 23 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)