Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use next-swc from branch for PR size stats #66964

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/next-stats-action/native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
15 changes: 13 additions & 2 deletions .github/actions/next-stats-action/src/prepare/repo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ module.exports = (actionInfo) => {
* @param {{ repoDir: string, nextSwcVersion: null | string }} options Required options
* @returns {Promise<Map<string, string>>} List packages key is the package name, value is the path to the packed tar file.'
*/
async linkPackages({ repoDir, nextSwcVersion, parentSpan }) {
async linkPackages({
repoDir,
nextSwcVersion: nextSwcVersionSpecified,
parentSpan,
}) {
if (!parentSpan) {
// Not all callers provide a parent span
parentSpan = mockSpan()
Expand Down Expand Up @@ -118,6 +122,11 @@ module.exports = (actionInfo) => {
}
})

const nextSwcVersion =
nextSwcVersionSpecified ??
pkgDatas.get('@next/swc')?.packedPackageTarPath ??
null

await parentSpan
.traceChild('write-packagejson')
.traceAsyncFn(async () => {
Expand Down Expand Up @@ -171,9 +180,11 @@ module.exports = (actionInfo) => {
})
if (nextSwcVersion) {
Object.assign(packageJson.dependencies, {
// CI
'@next/swc-linux-x64-gnu': nextSwcVersion,
// Vercel issued laptops
'@next/swc-darwin-arm64': nextSwcVersion,
Comment on lines +183 to +186
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only changed for local testing

})
} else {
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/.stats-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"license": "MIT",
"dependencies": {
"next": "19.0.0-rc-6230622a1a-20240610",
"next": "latest",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by. The version specified was not actually a Next.js version. It's overridden anyway.

"react": "19.0.0-rc-6230622a1a-20240610",
"react-dom": "19.0.0-rc-6230622a1a-20240610"
},
Expand Down
Loading