Merge branch 'main' into feat/ohos-support

This commit is contained in:
social4hyq 2026-07-27 19:56:02 +08:00 • committed by GitHub
commit ac52bfe80e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
92 changed files with 4787 additions and 1634 deletions

View file

@ -21,18 +21,25 @@ let workspaces = new Map()
for (let path of paths) {
let pkg = await fs.readFile(path, 'utf8').then(JSON.parse)
if (pkg.private) continue
workspaces.set(pkg.name, { version: pkg.version ?? '', dir: dirname(path) })
workspaces.set(pkg.name, {
version: pkg.version ?? '',
dir: dirname(path),
hasBundledDependencies: pkg.bundledDependencies?.length > 0 ?? false,
})
}
// Clean dist folder
await fs.rm(path.join(root, 'dist'), { recursive: true, force: true })
Promise.all(
[...workspaces.entries()].map(async ([name, { dir }]) => {
[...workspaces.entries()].map(async ([name, { dir, hasBundledDependencies }]) => {
function pack() {
return new Promise((resolve) => {
// `bundledDependencies` can only be packed with the hoisted node linker
// since pnpm v10. We opt into it for those packages only, instead of
// changing the node linker for the entire workspace.
exec(
`pnpm pack --pack-gzip-level=0 --pack-destination="${path.join(root, 'dist').replace(/\\/g, '\\\\')}"`,
`pnpm pack --pack-gzip-level=0 --pack-destination="${path.join(root, 'dist').replace(/\\/g, '\\\\')}"${hasBundledDependencies ? ' --config.node-linker=hoisted' : ''}`,
{ cwd: dir },
(err, stdout, stderr) => {
if (err) {