Skip to content

Commit 8637c48

Browse files
committed
Merge branch 'canary' of https://github.com/vercel/next.js into update-with-redux-example
2 parents c5e1372 + aa914ee commit 8637c48

File tree

5,583 files changed

+168236
-207396
lines changed

Some content is hidden

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

5,583 files changed

+168236
-207396
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ bench/nested-deps-app-router/**
3838
packages/next-bundle-analyzer/index.d.ts
3939
examples/with-typescript-graphql/lib/gql/
4040
test/development/basic/hmr/components/parse-error.js
41+
packages/next-swc/docs/assets/**/*

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# All revisions specified in the `.git-blame-ignore-revs` file, are hidden from the blame
2+
# when running `git blame --ignore-revs-file .git-blame-ignore-revs`.
3+
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
4+
5+
# chore(examples): use default prettier for examples/templates (#60530)
6+
4466ba436b996263307171d344cca199e8087744

.github/ISSUE_TEMPLATE/1.bug_report.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ body:
4040
placeholder: 'Following the steps from the previous section, I expected A to happen, but I observed B instead'
4141
validations:
4242
required: true
43-
- type: checkboxes
44-
attributes:
45-
label: Verify canary release
46-
description: 'Please run `npm install next@canary` to try the canary version of Next.js that ships daily. It includes all features and fixes that have not been released to the stable version yet. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue.'
47-
options:
48-
- label: I verified that the issue exists in the latest Next.js canary release
49-
required: true
5043
- type: textarea
5144
attributes:
5245
label: Provide environment information

.github/actions/next-integration-stat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"engines": {
2424
"node": ">=18.17.0",
25-
"pnpm": "8.9.0"
25+
"pnpm": "8.15.1"
2626
},
27-
"packageManager": "pnpm@8.9.0"
27+
"packageManager": "pnpm@8.15.1"
2828
}

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

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

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

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

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

.github/actions/next-stats-action/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"engines": {
2121
"node": ">=18.17.0",
22-
"pnpm": "8.9.0"
22+
"pnpm": "8.15.1"
2323
},
24-
"packageManager": "pnpm@8.9.0"
24+
"packageManager": "pnpm@8.15.1"
2525
}

.github/actions/next-stats-action/src/prepare/repo-setup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ module.exports = (actionInfo) => {
2727
)
2828
}
2929
// last stable tag will always be 1 patch less than canary
30-
return `${major}.${minor}.${Number(patch) - 1}`
30+
return `${major}.${minor}.${
31+
Number(patch) - tag.includes('-canary') ? 1 : 0
32+
}`
3133
},
3234
async getCommitId(repoDir = '') {
3335
const { stdout } = await exec(`cd ${repoDir} && git rev-parse HEAD`)

.github/actions/next-stats-action/src/run/collect-diffs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,15 @@ module.exports = async function collectDiffs(
3232
filesToTrack.map(async (fileGroup) => {
3333
const { globs } = fileGroup
3434
const curFiles = []
35+
const prettierExts = ['.js', '.html', '.css', '.json']
3536

3637
await Promise.all(
3738
globs.map(async (pattern) => {
38-
curFiles.push(...(await glob(pattern, { cwd: statsAppDir })))
39+
curFiles.push(
40+
...(await glob(pattern, { cwd: statsAppDir })).filter((item) =>
41+
prettierExts.includes(path.extname(item))
42+
)
43+
)
3944
})
4045
)
4146

.github/actions/pr-approved-open/dist/index.mjs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)