Merge branch 'main' into feat/ohos-support
This commit is contained in:
commit
ac52bfe80e
92 changed files with 4787 additions and 1634 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue