Skip to content

Commit

Permalink
Merge branch 'canary' into feat-experimental-webpack-css
Browse files Browse the repository at this point in the history
  • Loading branch information
noreiller committed Jun 24, 2022
2 parents 247fdac + 0867465 commit b4ea64e
Show file tree
Hide file tree
Showing 701 changed files with 18,534 additions and 5,335 deletions.
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Expand Up @@ -13,7 +13,7 @@ body:
label: Verify canary release
description: '`next@canary` is 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. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue.'
options:
- label: I verified that the issue exists in Next.js canary release
- label: I verified that the issue exists in the latest Next.js canary release
required: true
- type: textarea
attributes:
Expand Down Expand Up @@ -41,10 +41,16 @@ body:
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
attributes:
label: Link to reproduction
description: A link to a GitHub repository, a [StackBlitz](https://stackblitz.com/fork/github/vercel/next.js/tree/canary/examples/reproduction-template), or a [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from our [bug report template with `npx create next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below.
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
validations:
required: true
- type: markdown
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/2.example_bug_report.yml
Expand Up @@ -13,7 +13,7 @@ body:
label: Verify canary release
description: '`next@canary` is 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. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue.'
options:
- label: I verified that the issue exists in Next.js canary release
- label: I verified that the issue exists in the latest Next.js canary release
required: true
- type: textarea
attributes:
Expand All @@ -24,7 +24,7 @@ body:
- type: input
attributes:
label: Which example does this report relate to?
description: "See a complete list in the [examples folder](https://github.com/vercel/next.js/tree/canary/examples). For example: with-styled-components. Note: Examples not in the examples folder might be maintained by the example's library author. Check out their projects before opening the issue on Next.js"
description: "See a complete list in the [examples folder](https://github.com/vercel/next.js/tree/canary/examples). For example: `with-styled-components`. Note: Examples not in the examples folder might be maintained by the example's library author. Check out their projects before opening the issue on Next.js"
validations:
required: true
- type: input
Expand All @@ -50,7 +50,7 @@ body:
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below.
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the relevant example. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
validations:
required: true
- type: markdown
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/issue-validator/action.yml
@@ -0,0 +1,6 @@
name: Issue validator
description: 'Validates bug reports on the Next.js repository'
author: 'Vercel'
runs:
using: 'node16'
main: 'index.js'
97 changes: 97 additions & 0 deletions .github/actions/issue-validator/index.js
@@ -0,0 +1,97 @@
// @ts-check
import * as github from '@actions/github'
import * as core from '@actions/core'

const verifyCanaryLabel = 'please verify canary'
const bugReportLabel = 'template: bug'
const addReproductionLabel = 'please add a complete reproduction'

async function run() {
try {
const {
payload: { issue, pull_request },
repo,
} = github.context

if (pull_request || !issue?.body) return

const { body, labels, number: issueNumber } = issue

const isManuallyLabeled = labels.some(
(label) => label.name === verifyCanaryLabel
)

const isBugReport = labels.some((label) => label.name === bugReportLabel)

if (!process.env.GITHUB_TOKEN) {
return core.setFailed('GITHUB_TOKEN is not set')
}

// @ts-ignore
const client = github.getOctokit(process.env.GITHUB_TOKEN).rest

/**
* @param {string} label
* @param {string} comment
*/
function notifyOnIssue(label, comment) {
const issueCommon = { ...repo, issue_number: issueNumber }

return Promise.all([
client.issues.addLabels({ ...issueCommon, labels: [label] }),
client.issues.createComment({ ...issueCommon, body: comment }),
])
}

const isVerifyCanaryChecked = body.includes(
'- [X] I verified that the issue exists in Next.js canary release'
)

if (
!isVerifyCanaryChecked || // This can happen if the issue was from a comment in another issue or discussion.
isManuallyLabeled
) {
return await notifyOnIssue(
verifyCanaryLabel,
'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.'
)
}

if (!isBugReport) return

const reproductionUrl = body
.match(/### Link to reproduction\n\n(?<url>.*)\n/)
?.groups?.url.trim()

if (!reproductionUrl || !(await (await fetch(reproductionUrl)).ok)) {
return await notifyOnIssue(
addReproductionLabel,
'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field.'
)
}

const reportedNextVersion = body.match(
/Relevant packages:\n next: (?<version>\d+\.\d+\.\d+)/
)?.groups?.version

if (!reportedNextVersion) {
// REVIEW: Should we add a label here?
return
}

const { tag_name: lastVersion } = await (
await client.repos.listReleases(repo)
).data[0]

if (lastVersion.includes('canary') && reportedNextVersion !== lastVersion) {
return await notifyOnIssue(
verifyCanaryLabel,
`The reported Next.js version did not match the latest \`next@canary\` version (${lastVersion}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.`
)
}
} catch (error) {
core.setFailed(error.message)
}
}

run()
12 changes: 12 additions & 0 deletions .github/actions/issue-validator/package.json
@@ -0,0 +1,12 @@
{
"private": true,
"main": "index.js",
"type": "module",
"devDependencies": {
"typescript": "4.6.3"
},
"dependencies": {
"@actions/core": "1.9.0",
"@actions/github": "5.0.3"
}
}
2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/Dockerfile
Expand Up @@ -7,7 +7,7 @@ LABEL repository="https://github.com/vercel/next-stats-action"
COPY . /next-stats

# Install node_modules
RUN npm i -g pnpm@7.1.6
RUN npm i -g pnpm@7.2.1
RUN cd /next-stats && pnpm install --production

RUN git config --global user.email 'stats@localhost'
Expand Down
4 changes: 1 addition & 3 deletions .github/actions/next-stats-action/package.json
@@ -1,8 +1,6 @@
{
"name": "get-stats",
"version": "1.0.0",
"private": true,
"main": "src/index.js",
"license": "MIT",
"dependencies": {
"async-sema": "^3.1.0",
"fs-extra": "^8.1.0",
Expand Down

0 comments on commit b4ea64e

Please sign in to comment.