cli-module-build: pack packages in batches inside createDistWorkspace

When passing --always-yarn-pack, we previously
packed all packages in parallel. Since
package.json files are rewritten during packing,
this could cause intermittent "No local workspace
found for this range" failures.

To fix this, we now pack packages in batches,
starting with the ones that have no workspace
dependencies and expanding out to include packages
whose dependencies have already been packed.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2026-03-27 18:12:06 +00:00
parent 96882bbfb1
commit c16c5084d0
4 changed files with 227 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli-module-build': patch
---
When building dist-workspaces with --always-pack, batch `yarn pack` operations to avoid packing packages and their dependencies simultaneously.