-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Problem
When running build:modified or test:modified on a clean environment (fresh checkout, no dist/ present), any workspace that depends on another workspace will fail.
Root cause
yarn workspaces foreach --since -Rpt run build will affect modified workspaces and its dependants, but not dependencies. vite build and vitest resolve workspace imports using the main/module/exports fields in package.json, which all point to dist/. On a clean checkout dist/ does not exist, so build or test of modified workspaces with cross-dependencies on unmodified workspaces fails immediately.
Example
packages/core (no workspace deps)
packages/javascript (depends on @hawk.so/core)
packages/sveltekit (depends on @hawk.so/javascript)
Change only packages/javascript. --since -R selects javascript + sveltekit. Build order: javascript → sveltekit.
packages/javascripttries to import@hawk.so/core→ resolves topackages/core/dist/→ not found → build failspackages/sveltekitis never reached
Same issue for vitest: even though @hawk.so/core is not in the --since set, the test runner still needs to resolve it.
Impact
build:modifiedandtest:modifiedare broken on CI (fresh checkout) whenever a changed workspace has workspace dependencies that are not themselves changed- Developers on a clean clone must manually run
build:allbeforebuild:modifiedortest:modifiedcan work