-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Update next-swc handling for PR stats #50933
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ module.exports = (actionInfo) => { | |
} | ||
const pkgData = require(pkgDataPath) | ||
const { name } = pkgData | ||
|
||
pkgDatas.set(name, { | ||
pkgDataPath, | ||
pkg, | ||
|
@@ -103,7 +104,7 @@ module.exports = (actionInfo) => { | |
if (!pkgData.files) { | ||
pkgData.files = [] | ||
} | ||
pkgData.files.push('native/*') | ||
pkgData.files.push('native') | ||
require('console').log( | ||
'using swc binaries: ', | ||
await exec(`ls ${path.join(path.dirname(pkgDataPath), 'native')}`) | ||
|
@@ -124,18 +125,11 @@ module.exports = (actionInfo) => { | |
pkgData.dependencies['@next/swc'] = | ||
pkgDatas.get('@next/swc').packedPkgPath | ||
} else { | ||
pkgData.files.push('native/*') | ||
pkgData.files.push('native') | ||
} | ||
} | ||
} | ||
|
||
if (pkgData?.scripts?.prepublishOnly) { | ||
// There's a bug in `pnpm pack` where it will run | ||
// the prepublishOnly script and that will fail. | ||
// See https://github.com/pnpm/pnpm/issues/2941 | ||
delete pkgData.scripts.prepublishOnly | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we still need this since the linked issue was fixed in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ijjk This is only used for gh actions, it wont be used when I run |
||
|
||
await fs.writeFile( | ||
pkgDataPath, | ||
JSON.stringify(pkgData, null, 2), | ||
|
@@ -147,21 +141,13 @@ module.exports = (actionInfo) => { | |
// to the correct versions | ||
await Promise.all( | ||
Array.from(pkgDatas.keys()).map(async (pkgName) => { | ||
const { pkg, pkgPath, pkgData, packedPkgPath } = pkgDatas.get(pkgName) | ||
// Copied from pnpm source: https://github.com/pnpm/pnpm/blob/5a5512f14c47f4778b8d2b6d957fb12c7ef40127/releasing/plugin-commands-publishing/src/pack.ts#L96 | ||
const tmpTarball = path.join( | ||
pkgPath, | ||
`${pkgData.name.replace('@', '').replace('/', '-')}-${ | ||
pkgData.version | ||
}.tgz` | ||
) | ||
await execa('pnpm', ['pack'], { | ||
const { pkgPath, packedPkgPath } = pkgDatas.get(pkgName) | ||
|
||
await execa('yarn', ['pack', '-f', packedPkgPath], { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer updating pnpm rather that switch back to yarn Mixing package managers in the same repo can cause problems if you have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only run in CI so isn't affected by corepack |
||
cwd: pkgPath, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the very least, add the |
||
}) | ||
await fs.copyFile(tmpTarball, packedPkgPath) | ||
}) | ||
) | ||
|
||
return pkgPaths | ||
}, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably pass a
cwd
option here instead ofcd
right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh
cd
isn't even needed here was just copied from other logs