Skip to content

Commit 52f4af4

Browse files
committedJun 17, 2024
Use next-swc from branch for PR size stats
1 parent 12cc42f commit 52f4af4

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ module.exports = (actionInfo) => {
6565
* @param {{ repoDir: string, nextSwcVersion: null | string }} options Required options
6666
* @returns {Promise<Map<string, string>>} List packages key is the package name, value is the path to the packed tar file.'
6767
*/
68-
async linkPackages({ repoDir, nextSwcVersion, parentSpan }) {
68+
async linkPackages({
69+
repoDir,
70+
nextSwcVersion: nextSwcVersionSpecified,
71+
parentSpan,
72+
}) {
6973
if (!parentSpan) {
7074
// Not all callers provide a parent span
7175
parentSpan = mockSpan()
@@ -118,6 +122,11 @@ module.exports = (actionInfo) => {
118122
}
119123
})
120124

125+
const nextSwcVersion =
126+
nextSwcVersionSpecified ??
127+
pkgDatas.get('@next/swc')?.packedPackageTarPath ??
128+
null
129+
121130
await parentSpan
122131
.traceChild('write-packagejson')
123132
.traceAsyncFn(async () => {
@@ -171,9 +180,11 @@ module.exports = (actionInfo) => {
171180
})
172181
if (nextSwcVersion) {
173182
Object.assign(packageJson.dependencies, {
183+
// CI
174184
'@next/swc-linux-x64-gnu': nextSwcVersion,
185+
// Vercel issued laptops
186+
'@next/swc-darwin-arm64': nextSwcVersion,
175187
})
176-
} else {
177188
}
178189
}
179190

‎test/.stats-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"license": "MIT",
55
"dependencies": {
6-
"next": "19.0.0-rc-6230622a1a-20240610",
6+
"next": "latest",
77
"react": "19.0.0-rc-6230622a1a-20240610",
88
"react-dom": "19.0.0-rc-6230622a1a-20240610"
99
},

0 commit comments

Comments
 (0)