Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Merge branch 'canary' of https://github.com/hanneslund/next.js into g…
…roup-callstack-by-framework
  • Loading branch information
Hannes Bornö committed Jan 3, 2023
commit 99f83c95617c333d19d1ff2a672ef64120a9ef80
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
// Github latest can't be installed due to GPG issues: https://github.com/cli/cli/discussions/6222
// "github-cli": "latest",
},
// This is needed for forwarding X11: https://github.com/microsoft/vscode-remote-release/issues/3841
"runArgs": ["--net=host"],
"remoteEnv": {
"DISPLAY": ":0"
}
Expand Down
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ examples/with-flow/**
examples/with-jest/**
examples/with-mobx-state-tree/**
examples/with-mobx/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/bundles/webpack/packages/lazy-compilation-*.js
packages/next/compiled/**/*
packages/next/src/bundles/webpack/packages/*.runtime.js
packages/next/src/bundles/webpack/packages/lazy-compilation-*.js
packages/next/src/compiled/**/*
packages/react-refresh-utils/**/*.js
packages/react-dev-overlay/lib/**
**/__tmp__/**
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/next-stats-action/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"private": true,
"main": "src/index.js",
"scripts": {
"turbo": "turbo"
},
"dependencies": {
"async-sema": "^3.1.0",
"fs-extra": "^8.1.0",
Expand All @@ -12,6 +15,7 @@
"prettier": "^1.18.2",
"pretty-bytes": "^5.3.0",
"pretty-ms": "^5.0.0",
"semver": "7.3.4"
"semver": "7.3.4",
"turbo": "1.6.3"
}
}
54 changes: 47 additions & 7 deletions .github/actions/next-stats-action/src/prepare/repo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ const mockTrace = () => ({
traceChild: () => mockTrace(),
})

let turboRepoRoot = path.join(__dirname, '..', '..', '..', '..', '..')

// stats-action runs this code without access to the original repo.
// In that case we just use the temporary directory (everything is temporary anyway in CI)
if (turboRepoRoot === '/') {
turboRepoRoot = path.join(__dirname, '..', '..')
}

/** Save turbo cache to persistent storage */
const turboCacheLocation = path.join(turboRepoRoot, 'node_modules/.cache/turbo')
const packedPkgsDir = path.join(turboRepoRoot, 'test/tmp/packedPkgs')

module.exports = (actionInfo) => {
return {
async cloneRepo(repoPath = '', dest = '') {
Expand Down Expand Up @@ -72,7 +84,7 @@ module.exports = (actionInfo) => {
pkgs = await fs.readdir(path.join(repoDir, 'packages'))
} catch (err) {
if (err.code === 'ENOENT') {
console.log('no packages to link')
require('console').log('no packages to link')
return pkgPaths
}
throw err
Expand All @@ -81,13 +93,19 @@ module.exports = (actionInfo) => {
await rootSpan
.traceChild('prepare packages for packing')
.traceAsyncFn(async () => {
await fs.ensureDir(packedPkgsDir)
const repoData = require(path.join(repoDir, 'package.json'))

for (const pkg of pkgs) {
const pkgPath = path.join(repoDir, 'packages', pkg)
const packedPkgPath = path.join(pkgPath, `${pkg}-packed.tgz`)
const packedPkgPath = path.join(
packedPkgsDir,
`${pkg}-packed.tgz`
)

const pkgDataPath = path.join(pkgPath, 'package.json')
if (!fs.existsSync(pkgDataPath)) {
console.log(`Skipping ${pkgDataPath}`)
require('console').log(`Skipping ${pkgDataPath}`)
continue
}
const pkgData = require(pkgDataPath)
Expand All @@ -103,7 +121,8 @@ module.exports = (actionInfo) => {
}

for (const pkg of pkgDatas.keys()) {
const { pkgDataPath, pkgData } = pkgDatas.get(pkg)
const { pkgDataPath, pkgData, pkgPath, packedPkgPath } =
pkgDatas.get(pkg)

for (const pkg of pkgDatas.keys()) {
const { packedPkgPath } = pkgDatas.get(pkg)
Expand All @@ -118,7 +137,7 @@ module.exports = (actionInfo) => {
pkgData.files = []
}
pkgData.files.push('native')
console.log(
require('console').log(
'using swc binaries: ',
await exec(
`ls ${path.join(path.dirname(pkgDataPath), 'native')}`
Expand All @@ -139,6 +158,27 @@ module.exports = (actionInfo) => {
}
}

// Turbo requires package manager specification
pkgData.packageManager =
pkgData.packageManager || repoData.packageManager

pkgData.scripts = {
...pkgData.scripts,
'test-pack': `yarn pack -f ${packedPkgPath}`,
}

await fs.writeJSON(path.join(pkgPath, 'turbo.json'), {
pipeline: {
'test-pack': {
outputs: [packedPkgPath],
inputs: ['*', '!node_modules/', '!.turbo/'],
},
},
})

// Turbo requires pnpm-lock.yaml that is not empty
await fs.writeFile(path.join(pkgPath, 'pnpm-lock.yaml'), '')

await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
Expand All @@ -157,9 +197,9 @@ module.exports = (actionInfo) => {
await packingSpan
.traceChild(`pack ${pkgName}`)
.traceAsyncFn(async () => {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
const { pkgPath } = pkgDatas.get(pkgName)
await exec(
`cd ${pkgPath} && yarn pack -f '${pkg}-packed.tgz'`,
`pnpm run --dir="${turboRepoRoot}" turbo run test-pack --cache-dir="${turboCacheLocation}" --cwd="${pkgPath}"`,
true
)
})
Expand Down
13 changes: 12 additions & 1 deletion .github/labeler.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@
{ "type": "user", "pattern": "styfle" },
{ "type": "user", "pattern": "leerob" },
{ "type": "user", "pattern": "kdy1" },
{ "type": "user", "pattern": "timneutkens" }
{ "type": "user", "pattern": "timneutkens" },
{ "type": "user", "pattern": "sebmarkbage" },
{ "type": "user", "pattern": "wyattjoh" },
{ "type": "user", "pattern": "kwonoj" },
{ "type": "user", "pattern": "gnoff" },
{ "type": "user", "pattern": "padmaia" },
{ "type": "user", "pattern": "Brooooooklyn" },
{ "type": "user", "pattern": "ForsakenHarmony" },
{ "type": "user", "pattern": "feedthejim" },
{ "type": "user", "pattern": "JanKaifer" },
{ "type": "user", "pattern": "balazsorban44" },
{ "type": "user", "pattern": "hanneslund" }
],
"created-by: Next.js docs team": [
{ "type": "user", "pattern": "MaedahBatool" },
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
name: Build, test, and deploy

env:
NAPI_CLI_VERSION: 2.12.0
NAPI_CLI_VERSION: 2.13.3
TURBO_VERSION: 1.6.3
RUST_TOOLCHAIN: nightly-2022-11-04
PNPM_VERSION: 7.3.0
Expand Down Expand Up @@ -1128,7 +1128,7 @@ jobs:
target: 'aarch64-pc-windows-msvc'
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features
turbo run build-native-no-plugin-woa -- --release --target aarch64-pc-windows-msvc --cargo-flags=--no-default-features
if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.swcChange == 'yup' && needs.build.outputs.turboToken != 'empty') }}
needs: build
name: stable - ${{ matrix.settings.target }} - node@16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
name: Generate Pull Request Stats

env:
NAPI_CLI_VERSION: 2.12.0
NAPI_CLI_VERSION: 2.13.3
TURBO_VERSION: 1.6.3
RUST_TOOLCHAIN: nightly-2022-11-04
PNPM_VERSION: 7.3.0
Expand Down
6 changes: 3 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ node_modules
**/.next/**
**/_next/**
**/dist/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/bundles/webpack/packages/lazy-compilation-*.js
packages/next/compiled/**
packages/next/src/bundles/webpack/packages/*.runtime.js
packages/next/src/bundles/webpack/packages/lazy-compilation-*.js
packages/next/src/compiled/**
packages/react-refresh-utils/**/*.js
packages/react-refresh-utils/**/*.d.ts
packages/react-dev-overlay/lib/**
Expand Down
44 changes: 41 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ stages:
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests'

- job: test_integration_app_dir
- job: test_e2e_dev
pool:
vmImage: 'windows-2019'
steps:
Expand Down Expand Up @@ -139,6 +139,44 @@ stages:
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 test/integration/app-dir-basic/test/index.test.js
node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests'
displayName: 'Run tests (E2E Development)'
env:
NEXT_TEST_MODE: 'dev'

- job: test_e2e_prod
pool:
vmImage: 'windows-2019'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_16_version)
displayName: 'Install Node.js'

- bash: |
node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
displayName: 'Check Docs Only Change'

- script: npm i -g pnpm@$(PNPM_VERSION)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm store path
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm install && pnpm run build
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Install and build'

- script: npx playwright install chromium
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests (E2E Production)'
env:
NEXT_TEST_MODE: 'start'
4 changes: 2 additions & 2 deletions contributing/core/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
To develop locally:

1. Install the [GitHub CLI](https://github.com/cli/cli#installation).
1. Clone the Next.js repository:
1. Clone the Next.js repository (download only recent commits for faster clone):
```
gh repo clone vercel/next.js
gh repo clone vercel/next.js -- --depth=3000 --branch canary --single-branch
```
1. Create a new branch:
```
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.