()
| 34 | Promise.all( |
| 35 | [...workspaces.entries()].map(async ([name, { dir, hasBundledDependencies }]) => { |
| 36 | function pack() { |
| 37 | return new Promise((resolve) => { |
| 38 | // `bundledDependencies` can only be packed with the hoisted node linker |
| 39 | // since pnpm v10. We opt into it for those packages only, instead of |
| 40 | // changing the node linker for the entire workspace. |
| 41 | exec( |
| 42 | `pnpm pack --pack-gzip-level=0 --pack-destination="${path.join(root, 'dist').replace(/\\/g, '\\\\')}"${hasBundledDependencies ? ' --config.node-linker=hoisted' : ''}`, |
| 43 | { cwd: dir }, |
| 44 | (err, stdout, stderr) => { |
| 45 | if (err) { |
| 46 | console.error(err, stdout, stderr) |
| 47 | } |
| 48 | |
| 49 | resolve(lastLine(stdout.trim())) |
| 50 | }, |
| 51 | ) |
| 52 | }) |
| 53 | } |
| 54 | |
| 55 | let filename = await pack() |
| 56 | // Remove version suffix |
no test coverage detected