Skip to content

Commit

Permalink
Merge branch 'canary' into fix-next-image-with-trailing-slash
Browse files Browse the repository at this point in the history
  • Loading branch information
fliptheweb committed Sep 17, 2021
2 parents c2d0455 + 29ab433 commit cacb0d5
Show file tree
Hide file tree
Showing 3,366 changed files with 223,905 additions and 135,873 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .alexignore
@@ -0,0 +1,2 @@
CODE_OF_CONDUCT.md
examples/
21 changes: 21 additions & 0 deletions .alexrc
@@ -0,0 +1,21 @@
{
"allow": [
"attacks",
"color",
"dead",
"execute",
"executed",
"executes",
"execution",
"executions",
"failed",
"failure",
"failures",
"fire",
"fires",
"hook",
"hooks",
"host-hostess",
"invalid"
]
}
15 changes: 13 additions & 2 deletions .eslintignore
Expand Up @@ -2,8 +2,15 @@ node_modules
**/.next/**
**/_next/**
**/dist/**
e2e-tests/**
examples/with-eslint/**
examples/with-typescript-eslint-jest/**
examples/with-kea/**
examples/with-custom-babel-config/**
examples/with-flow/**
examples/with-jest/**
examples/with-mobx-state-tree/**
examples/with-mobx/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/compiled/**/*
packages/react-refresh-utils/**/*.js
Expand All @@ -15,5 +22,9 @@ packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts
test/integration/async-modules/**
test-timings.json
packages/create-next-app/templates/**
test/integration/eslint/**
test-timings.json
packages/next/build/swc/tests/fixture/**
bench/nested-deps/pages/**
bench/nested-deps/components/**
16 changes: 13 additions & 3 deletions .eslintrc.json
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": ["react", "react-hooks", "jest", "import"],
"env": {
"browser": true,
Expand All @@ -9,10 +9,17 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 2018,
"requireConfigFile": false,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"babelOptions": {
"presets": ["@babel/preset-env", "@babel/preset-react"],
"caller": {
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
"supportsTopLevelAwait": true
}
}
},
"settings": {
Expand All @@ -27,7 +34,10 @@
"extends": ["plugin:jest/recommended"],
"rules": {
"jest/expect-expect": "off",
"jest/no-disabled-tests": "off"
"jest/no-disabled-tests": "off",
"jest/no-conditional-expect": "off",
"jest/valid-title": "off",
"jest/no-interpolation-in-snapshots": "off"
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
Expand Down
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,6 +1,6 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners

* @timneutkens @Timer @ijjk @lfades @divmain
/docs/ @timneutkens @Timer @ijjk @lfades @divmain @leerob
/examples/ @timneutkens @Timer @ijjk @lfades @divmain @leerob
* @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades
/examples/ @timneutkens @ijjk @shuding @leerob @lfades
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
@@ -1,8 +1,6 @@
name: Bug Report
about: Create a bug report for the Next.js core
title: ''
description: Create a bug report for the Next.js core
labels: 'template: bug'
issue_body: true
body:
- type: markdown
attributes:
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/2.example_bug_report.yml
@@ -1,8 +1,6 @@
name: Example Bug Report
about: Create a bug report for the examples
title: ''
description: Create a bug report for the examples
labels: 'type: example,template: bug'
issue_body: true
body:
- type: markdown
attributes:
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/3.feature_request.yml
@@ -1,8 +1,6 @@
name: Feature Request
about: Create a feature request for the Next.js core
title: ''
description: Create a feature request for the Next.js core
labels: 'template: story'
issue_body: true
body:
- type: markdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/Dockerfile
@@ -1,8 +1,8 @@
FROM node:10-buster
FROM node:14-buster

LABEL com.github.actions.name="Next.js PR Stats"
LABEL com.github.actions.description="Compares stats of a PR with the main branch"
LABEL repository="https://github.com/zeit/next-stats-action"
LABEL repository="https://github.com/vercel/next-stats-action"

COPY . /next-stats

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/src/add-comment.js
Expand Up @@ -83,7 +83,7 @@ module.exports = async function addComment(
else if (!isGzipItem && !groupKey.match(gzipIgnoreRegex)) return

if (
itemKey !== 'buildDuration' ||
!itemKey.startsWith('buildDuration') ||
(isBenchmark && itemKey.match(/req\/sec/))
) {
if (typeof mainItemVal === 'number') mainRepoTotal += mainItemVal
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/next-stats-action/src/index.js
Expand Up @@ -102,13 +102,17 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
logger(`Running initial build for ${dir}`)
if (!actionInfo.skipClone) {
let buildCommand = `cd ${dir}${
!statsConfig.skipInitialInstall ? ' && yarn install' : ''
!statsConfig.skipInitialInstall
? ' && yarn install --network-timeout 1000000'
: ''
}`

if (statsConfig.initialBuildCommand) {
buildCommand += ` && ${statsConfig.initialBuildCommand}`
}
await exec(buildCommand)
// allow 5 minutes node_modules install + building all packages
// in case of noisy environment slowing down initial repo build
await exec(buildCommand, false, { timeout: 5 * 60 * 1000 })
}

logger(`Linking packages in ${dir}`)
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/next-stats-action/src/prepare/repo-setup.js
Expand Up @@ -93,6 +93,10 @@ module.exports = (actionInfo) => {
if (!pkgData.dependencies || !pkgData.dependencies[pkg]) continue
pkgData.dependencies[pkg] = packedPkgPath
}
// make sure native binaries are included in local linking
if (pkg === 'next') {
pkgData.files.push('native')
}
await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
Expand All @@ -104,7 +108,7 @@ module.exports = (actionInfo) => {
// to the correct versions
for (const pkgName of pkgDatas.keys()) {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true)
}
return pkgPaths
},
Expand Down
48 changes: 29 additions & 19 deletions .github/actions/next-stats-action/src/run/index.js
Expand Up @@ -26,6 +26,7 @@ async function runConfigs(
let curStats = {
General: {
buildDuration: null,
buildDurationCached: null,
nodeModulesSize: null,
},
}
Expand Down Expand Up @@ -55,20 +56,25 @@ async function runConfigs(
)
}

const buildStart = new Date().getTime()
const buildStart = Date.now()
await exec(`cd ${statsAppDir} && ${statsConfig.appBuildCommand}`, false, {
env: yarnEnvValues,
})
curStats.General.buildDuration = new Date().getTime() - buildStart
curStats.General.buildDuration = Date.now() - buildStart

// apply renames to get deterministic output names
for (const rename of config.renames) {
const results = await glob(rename.srcGlob, { cwd: statsAppDir })
if (results.length === 0 || results[0] === rename.dest) continue
await fs.move(
path.join(statsAppDir, results[0]),
path.join(statsAppDir, rename.dest)
)
for (const result of results) {
let dest = rename.removeHash
? result.replace(/(\.|-)[0-9a-f]{20}(\.|-)/g, '$1HASH$2')
: rename.dest
if (result === dest) continue
await fs.move(
path.join(statsAppDir, result),
path.join(statsAppDir, dest)
)
}
}

const collectedStats = await collectStats(config, statsConfig)
Expand All @@ -80,19 +86,17 @@ async function runConfigs(
const applyRenames = (renames, stats) => {
if (renames) {
for (const rename of renames) {
let { cur, prev } = rename
cur = path.basename(cur)
prev = path.basename(prev)

Object.keys(stats).forEach((group) => {
Object.keys(stats[group]).forEach((item) => {
let { cur, prev } = rename
cur = path.basename(cur)
prev = path.basename(prev)

if (cur === item) {
stats[group][prev] = stats[group][item]
stats[group][prev + ' gzip'] = stats[group][item + ' gzip']
delete stats[group][item]
delete stats[group][item + ' gzip']
}
})
if (stats[group][cur]) {
stats[group][prev] = stats[group][cur]
stats[group][prev + ' gzip'] = stats[group][cur + ' gzip']
delete stats[group][cur]
delete stats[group][cur + ' gzip']
}
})
}
}
Expand Down Expand Up @@ -146,6 +150,12 @@ async function runConfigs(
/* eslint-disable-next-line */
mainRepoStats = curStats
}

const secondBuildStart = Date.now()
await exec(`cd ${statsAppDir} && ${statsConfig.appBuildCommand}`, false, {
env: yarnEnvValues,
})
curStats.General.buildDurationCached = Date.now() - secondBuildStart
}

logger(`Finished running: ${config.title}`)
Expand Down
24 changes: 23 additions & 1 deletion .github/labeler.json
Expand Up @@ -7,7 +7,29 @@
"packages/next/**",
"packages/react-dev-overlay/**",
"packages/react-refresh-utils/**",
"packages/next-codemod/**"
"packages/next-codemod/**",
"packages/eslint-plugin-next/**",
"packages/eslint-config-next/**",
"packages/next-env/**"
],
"created-by: Chrome Aurora": [
{ "type": "user", "pattern": "spanicker" },
{ "type": "user", "pattern": "housseindjirdeh" },
{ "type": "user", "pattern": "devknoll" },
{ "type": "user", "pattern": "janicklas-ralph" },
{ "type": "user", "pattern": "atcastle" },
{ "type": "user", "pattern": "kyliau" },
{ "type": "user", "pattern": "kara" }
],
"created-by: Next.js team": [
{ "type": "user", "pattern": "ijjk" },
{ "type": "user", "pattern": "padmaia" },
{ "type": "user", "pattern": "huozhi" },
{ "type": "user", "pattern": "shuding" },
{ "type": "user", "pattern": "sokra" },
{ "type": "user", "pattern": "styfle" },
{ "type": "user", "pattern": "leerob" },
{ "type": "user", "pattern": "timneutkens" }
]
}
}
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
@@ -0,0 +1,24 @@
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes

0 comments on commit cacb0d5

Please sign in to comment.