Skip to content

Commit f587e0e

Browse files
authored
Merge branch 'canary' into cms-builder-io-example
2 parents 717862d + b7fb315 commit f587e0e

File tree

3,822 files changed

+228516
-281240
lines changed

Some content is hidden

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

3,822 files changed

+228516
-281240
lines changed

.alexignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CODE_OF_CONDUCT.md
2+
examples/

.alexrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"allow": [
3+
"attacks",
4+
"color",
5+
"dead",
6+
"execute",
7+
"executed",
8+
"executes",
9+
"execution",
10+
"executions",
11+
"failed",
12+
"failure",
13+
"failures",
14+
"fire",
15+
"fires",
16+
"hook",
17+
"hooks",
18+
"host-hostess",
19+
"invalid"
20+
]
21+
}

.eslintignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ e2e-tests/**
66
examples/with-eslint/**
77
examples/with-typescript-eslint-jest/**
88
examples/with-kea/**
9+
examples/with-custom-babel-config/**
10+
examples/with-flow/**
11+
examples/with-jest/**
12+
examples/with-mobx-state-tree/**
13+
examples/with-mobx/**
914
packages/next/bundles/webpack/packages/*.runtime.js
1015
packages/next/compiled/**/*
1116
packages/react-refresh-utils/**/*.js
@@ -18,6 +23,9 @@ packages/next-codemod/**/*.js
1823
packages/next-codemod/**/*.d.ts
1924
packages/next-env/**/*.d.ts
2025
packages/create-next-app/templates/**
21-
test/integration/async-modules/**
2226
test/integration/eslint/**
27+
test/development/basic/legacy-decorators/**/*
2328
test-timings.json
29+
packages/next-swc/crates/**
30+
bench/nested-deps/pages/**
31+
bench/nested-deps/components/**

.eslintrc.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"root": true,
3-
"parser": "babel-eslint",
3+
"parser": "@babel/eslint-parser",
44
"plugins": ["react", "react-hooks", "jest", "import"],
55
"env": {
66
"browser": true,
@@ -9,10 +9,17 @@
99
"node": true
1010
},
1111
"parserOptions": {
12-
"ecmaVersion": 2018,
12+
"requireConfigFile": false,
1313
"sourceType": "module",
1414
"ecmaFeatures": {
1515
"jsx": true
16+
},
17+
"babelOptions": {
18+
"presets": ["@babel/preset-env", "@babel/preset-react"],
19+
"caller": {
20+
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
21+
"supportsTopLevelAwait": true
22+
}
1623
}
1724
},
1825
"settings": {
@@ -23,14 +30,15 @@
2330
},
2431
"overrides": [
2532
{
26-
"files": ["test/**/*.test.js"],
33+
"files": ["test/**/*.js", "test/**/*.ts", "**/*.test.ts"],
2734
"extends": ["plugin:jest/recommended"],
2835
"rules": {
2936
"jest/expect-expect": "off",
3037
"jest/no-disabled-tests": "off",
3138
"jest/no-conditional-expect": "off",
3239
"jest/valid-title": "off",
33-
"jest/no-interpolation-in-snapshots": "off"
40+
"jest/no-interpolation-in-snapshots": "off",
41+
"jest/no-export": "off"
3442
}
3543
},
3644
{ "files": ["**/__tests__/**"], "env": { "jest": true } },

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages/next/bundles/** -text
2+
packages/next/compiled/** -text

.github/.kodiak.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ notify_on_conflict = false
1313
[merge.message]
1414
title = "pull_request_title"
1515
body = "pull_request_body"
16+
include_coauthors= true
1617
include_pr_number = true
1718
body_type = "markdown"
1819
strip_html_comments = true

.github/CODEOWNERS

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Learn how to add code owners here:
22
# https://help.github.com/en/articles/about-code-owners
33

4-
* @timneutkens @ijjk @lfades @divmain @shuding
5-
/docs/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
6-
/examples/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
4+
* @timneutkens @ijjk @shuding @huozhi
5+
/.github/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
6+
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades @molebox
7+
/examples/ @timneutkens @ijjk @shuding @leerob @lfades
8+
9+
# SWC Build (@padmaia)
10+
11+
/packages/next/build/ @timneutkens @ijjk @shuding @padmaia @huozhi
12+
13+
# Image Component (@styfle)
14+
15+
/examples/image-component/ @timneutkens @ijjk @shuding @styfle
16+
/packages/next/build/webpack/loaders/next-image-loader.js @timneutkens @ijjk @shuding @styfle
17+
/packages/next/client/image.tsx @timneutkens @ijjk @shuding @styfle
18+
/packages/next/image-types/ @timneutkens @ijjk @shuding @styfle
19+
/packages/next/server/image-config.ts @timneutkens @ijjk @shuding @styfle
20+
/packages/next/server/image-optimizer.ts @timneutkens @ijjk @shuding @styfle
21+
/packages/next/server/serve-static.ts @timneutkens @ijjk @shuding @styfle
22+
/packages/next/server/config.ts @timneutkens @ijjk @shuding @styfle
23+
/test/integration/image-optimizer/ @timneutkens @ijjk @shuding @styfle
24+
/test/integration/image-component/ @timneutkens @ijjk @shuding @styfle

.github/actions/next-stats-action/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM node:10-buster
1+
FROM node:14-buster
22

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

77
COPY . /next-stats
88

.github/actions/next-stats-action/src/index.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
4545
await checkoutRef(actionInfo.prRef, diffRepoDir)
4646
}
4747

48+
if (actionInfo.isRelease) {
49+
process.env.STATS_IS_RELEASE = 'true'
50+
}
51+
4852
// load stats config from allowed locations
4953
const { statsConfig, relativeStatsAppDir } = loadStatsConfig()
5054

@@ -102,14 +106,27 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
102106
logger(`Running initial build for ${dir}`)
103107
if (!actionInfo.skipClone) {
104108
let buildCommand = `cd ${dir}${
105-
!statsConfig.skipInitialInstall ? ' && yarn install' : ''
109+
!statsConfig.skipInitialInstall
110+
? ' && yarn install --network-timeout 1000000'
111+
: ''
106112
}`
107113

108114
if (statsConfig.initialBuildCommand) {
109115
buildCommand += ` && ${statsConfig.initialBuildCommand}`
110116
}
111-
await exec(buildCommand)
117+
// allow 5 minutes node_modules install + building all packages
118+
// in case of noisy environment slowing down initial repo build
119+
await exec(buildCommand, false, { timeout: 5 * 60 * 1000 })
112120
}
121+
await fs.copy(
122+
path.join(__dirname, '../native'),
123+
path.join(dir, 'packages/next-swc/native')
124+
)
125+
// TODO: remove after next stable release (current v12.0.4)
126+
await fs.copy(
127+
path.join(__dirname, '../native'),
128+
path.join(dir, 'packages/next/native')
129+
)
113130

114131
logger(`Linking packages in ${dir}`)
115132
const pkgPaths = await linkPackages(dir)

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ module.exports = (actionInfo) => {
7373
const packedPkgPath = path.join(pkgPath, `${pkg}-packed.tgz`)
7474

7575
const pkgDataPath = path.join(pkgPath, 'package.json')
76+
if (!fs.existsSync(pkgDataPath)) {
77+
console.log(`Skipping ${pkgDataPath}`)
78+
continue
79+
}
7680
const pkgData = require(pkgDataPath)
7781
const { name } = pkgData
7882
pkgDatas.set(name, {
@@ -93,6 +97,25 @@ module.exports = (actionInfo) => {
9397
if (!pkgData.dependencies || !pkgData.dependencies[pkg]) continue
9498
pkgData.dependencies[pkg] = packedPkgPath
9599
}
100+
// make sure native binaries are included in local linking
101+
if (pkg === '@next/swc') {
102+
if (!pkgData.files) {
103+
pkgData.files = []
104+
}
105+
pkgData.files.push('native')
106+
console.log(
107+
'using swc binaries: ',
108+
await exec(`ls ${path.join(path.dirname(pkgDataPath), 'native')}`)
109+
)
110+
}
111+
if (pkg === 'next') {
112+
if (pkgDatas.get('@next/swc')) {
113+
pkgData.dependencies['@next/swc'] =
114+
pkgDatas.get('@next/swc').packedPkgPath
115+
} else {
116+
pkgData.files.push('native')
117+
}
118+
}
96119
await fs.writeFile(
97120
pkgDataPath,
98121
JSON.stringify(pkgData, null, 2),
@@ -104,7 +127,7 @@ module.exports = (actionInfo) => {
104127
// to the correct versions
105128
for (const pkgName of pkgDatas.keys()) {
106129
const { pkg, pkgPath } = pkgDatas.get(pkgName)
107-
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`)
130+
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true)
108131
}
109132
return pkgPaths
110133
},

0 commit comments

Comments
 (0)