Skip to content

Commit 55e6749

Browse files
committed
Use next-swc from branch for PR size stats
1 parent 12cc42f commit 55e6749

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed
Lines changed: 4 additions & 0 deletions
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

Lines changed: 16 additions & 7 deletions
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 () => {
@@ -169,12 +178,12 @@ module.exports = (actionInfo) => {
169178
nextSwcVersion,
170179
nextSwcPkg,
171180
})
172-
if (nextSwcVersion) {
173-
Object.assign(packageJson.dependencies, {
174-
'@next/swc-linux-x64-gnu': nextSwcVersion,
175-
})
176-
} else {
177-
}
181+
Object.assign(packageJson.dependencies, {
182+
// CI
183+
'@next/swc-linux-x64-gnu': nextSwcVersion,
184+
// Vercel issued laptops
185+
'@next/swc-darwin-arm64': nextSwcVersion,
186+
})
178187
}
179188

180189
await fs.promises.writeFile(

test/.stats-app/package.json

Lines changed: 1 addition & 1 deletion
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)