Skip to content

Commit

Permalink
Merge branch 'canary' into third-party-gtm-accept-object
Browse files Browse the repository at this point in the history
  • Loading branch information
samcx authored Jul 25, 2024
2 parents 5453b13 + 528d397 commit 018d77a
Show file tree
Hide file tree
Showing 1,313 changed files with 11,634 additions and 5,095 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test/production/emit-decorator-metadata/**/*.js
!test/**/*.test.*
test/e2e/app-dir/rsc-errors/app/swc/use-client/page.js
test-timings.json
packages/next-swc/crates/**
crates/**
bench/nested-deps/**
bench/nested-deps-app-router/**
bench/heavy-npm-deps/**
Expand Down
20 changes: 20 additions & 0 deletions .eslintrc.cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json.schemastore.org/eslintrc",
"extends": [".eslintrc.json"],
"overrides": [
{
// This override adds type-checked rules.
"files": ["**/*.ts", "**/*.tsx"],
// Linting with type-checked rules is very slow and needs a lot of memory,
// so we exclude non-essential files.
"excludedFiles": ["examples/**/*", "test/**/*", "**/*.d.ts"],
"parserOptions": {
"project": true
},
"rules": {
// TODO: enable in follow-up PR
"@typescript-eslint/no-floating-promises": "off"
}
}
]
}
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
// This is the default eslint config that is used by IDEs. It does not use
// computation-heavy type-checked rules to ensure maximum responsiveness while
// writing code. In addition, there is .eslintrc.cli.json that does use
// type-checked rules, and it is used when running `pnpm lint-eslint`.
"$schema": "https://json.schemastore.org/eslintrc",
"root": true,
"parser": "@babel/eslint-parser",
"plugins": ["react", "react-hooks", "jest", "import", "jsdoc"],
Expand Down
1 change: 1 addition & 0 deletions .github/.react-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19.0.0-rc-6230622a1a-20240610
5 changes: 3 additions & 2 deletions .github/labeler.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"examples": ["examples/**"],
"Font (next/font)": ["**/*font*"],
"tests": ["test/**", "bench/**"],
"Turbopack": ["packages/next-swc/crates/next-*/**"],
"Turbopack": ["crates/next-*/**"],
"created-by: Chrome Aurora": [
{ "type": "user", "pattern": "atcastle" },
{ "type": "user", "pattern": "devknoll" },
Expand Down Expand Up @@ -71,6 +71,7 @@
"packages/next-swc/**",
"packages/next/**",
"packages/react-refresh-utils/**"
]
],
"type: react-sync": [".github/.react-version"]
}
}
12 changes: 6 additions & 6 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
NAPI_CLI_VERSION: 2.16.2
TURBO_VERSION: 2.0.6-canary.0
TURBO_VERSION: 2.0.7
NODE_LTS_VERSION: 20
CARGO_PROFILE_RELEASE_LTO: 'true'
TURBO_TEAM: 'vercel'
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- settings:
target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'i686-pc-windows-msvc' }}
- settings:
target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'x86_64-pc-windows-msvc' }}
target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-pc-windows-msvc' }}
- settings:
target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-unknown-linux-musl' }}
- settings:
Expand Down Expand Up @@ -429,7 +429,7 @@ jobs:
run: turbo run build-wasm -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}

- name: Add target to folder name
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }} || ls packages/next-swc/crates/wasm'
run: '[[ -d "crates/wasm/pkg" ]] && mv crates/wasm/pkg crates/wasm/pkg-${{ matrix.target }} || ls crates/wasm'

- name: Upload turbo summary artifact
uses: actions/upload-artifact@v4
Expand All @@ -441,7 +441,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: wasm-binaries-${{matrix.target}}
path: packages/next-swc/crates/wasm/pkg-*
path: crates/wasm/pkg-*

deploy-tarball:
if: ${{ needs.deploy-target.outputs.value != 'production' }}
Expand Down Expand Up @@ -486,7 +486,7 @@ jobs:
with:
pattern: wasm-binaries-*
merge-multiple: true
path: packages/next-swc/crates/wasm
path: crates/wasm

- name: Create tarballs
run: node scripts/create-preview-tarballs.js "${{ github.sha }}" "${{ runner.temp }}/preview-tarballs"
Expand Down Expand Up @@ -546,7 +546,7 @@ jobs:
with:
pattern: wasm-binaries-*
merge-multiple: true
path: packages/next-swc/crates/wasm
path: crates/wasm

- run: npm i -g npm@10.4.0 # need latest version for provenance (pinning to avoid bugs)
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.6-canary.0
TURBO_VERSION: 2.0.7
NODE_MAINTENANCE_VERSION: 18
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 8
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:

uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs && git checkout . && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts
afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs && git checkout . && mv crates/wasm/pkg crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts
stepName: 'test-next-swc-wasm'
secrets: inherit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Code Freeze

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.6-canary.0
TURBO_VERSION: 2.0.7
NODE_LTS_VERSION: 20

jobs:
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 @@ -6,7 +6,7 @@ name: Generate Pull Request Stats

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.6-canary.0
TURBO_VERSION: 2.0.7
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
"resolved": ".github/comments/resolved.md"
}
reproduction-comment: '.github/comments/invalid-link.md'
reproduction-hosts: 'github.com,codesandbox.io,stackblitz.com'
reproduction-hosts: 'github.com,bitbucket.org,gitlab.com,codesandbox.io,stackblitz.com'
reproduction-blocklist: 'github.com/vercel/next.js.*,github.com/\\w*/?$,github.com$'
reproduction-link-section: '### Link to the code that reproduces this issue(.*)### To Reproduce'
reproduction-invalid-label: 'invalid link'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ name: Trigger Release

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.6-canary.0
TURBO_VERSION: 2.0.7
NODE_LTS_VERSION: 20

jobs:
Expand Down
46 changes: 42 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
#!/usr/bin/env bash

main_branch="canary"
protected_branch='canary'

branch="$(git rev-parse --abbrev-ref HEAD)"
protected_remote_urls=(
'git@github.com:vercel/next.js.git'
'https://github.com/vercel/next.js.git' # github blocks password-based auth, but still usable via API token
)

if [ "$branch" = "$main_branch" ]; then
echo "You probably didn't intend to push directly to '$main_branch'." >&2

# The pre-push hook [...] receives the name and location of the remote as parameters
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
remote_name="$1"
remote_url="$2"



# if we're pushing to a fork, we don't need to protect canary.
# check if the remote is one of the protected ones.
is_remote_protected=0
for protected_remote_url in "${protected_remote_urls[@]}"; do
if [ "$remote_url" = "$protected_remote_url" ]; then
is_remote_protected=1
break
fi
done

if [ "$is_remote_protected" = 0 ]; then
exit 0
fi



# check if the push is targeting canary on the remote
# https://stackoverflow.com/a/44156933
push_targets_protected_branch=0
protected_ref="refs/heads/$protected_branch"
while read -r _local_ref _local_sha remote_ref _remote_sha; do
if [ "$remote_ref" = "$protected_ref" ]; then
push_targets_protected_branch=1
break
fi
done

if [ "$push_targets_protected_branch" = "1" ]; then
echo "You probably didn't intend to push directly to '$protected_branch' on '$remote_name' ($remote_url)." >&2
echo "If you're sure that that's what you want to do, bypass this check via" >&2
echo "" >&2
echo " git push --no-verify" >&2
Expand Down
18 changes: 9 additions & 9 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ packages/next/src/bundles/webpack/packages/lazy-compilation-*.js

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

packages/next-swc/crates/**/tests/**/output*
packages/next-swc/crates/core/tests/loader/issue-32553/input.js
crates/**/tests/**/output*
crates/core/tests/loader/issue-32553/input.js
# prettier destroys the directives here
packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/input.js
packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/input.js
packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/input.js
packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/input.js
packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/input.js
packages/next-swc/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/input.js
packages/next-swc/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/input.js
crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/input.js
crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/input.js
crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/input.js
crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/input.js
crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/input.js
crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/input.js
crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/input.js
packages/next-swc/native/**/*
packages/next-swc/docs/assets/**/*

Expand Down
Loading

0 comments on commit 018d77a

Please sign in to comment.