chore(build,test): split desktop/mobile from default build; share vitest worker budget

- pnpm build now excludes @fusion/desktop and @fusion/mobile by default
  (recursive build still available as pnpm build:all). Saves time on
  workspace-wide builds that don't need the native shells.
- Hoist the per-package max-worker computation into a shared
  packages/core/src/__test-utils__/vitest-workers.ts util. Every
  vitest.config.ts now calls computeMaxWorkers(), which honors
  VITEST_MAX_WORKERS, FUSION_TEST_TOTAL_WORKERS, and a per-config
  defaultCap, clamped to cpus-1.
- pnpm test sets VITEST_MAX_WORKERS=2 so the workspace run keeps total
  fan-out modest with --workspace-concurrency=2.
- Switch dashboard vitest pool from forks to threads so jsdom/React
  suites share a V8 heap instead of duplicating ~500MB per worker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-02 15:56:15 -07:00
parent cea3f831bc
commit 7a2da530b9
18 changed files with 90 additions and 79 deletions

View File

@@ -19,10 +19,11 @@ Thanks for contributing to Fusion.
pnpm install --frozen-lockfile
```
### Build all packages
### Build workspace packages
```bash
pnpm build
pnpm build # default build (excludes desktop/mobile)
pnpm build:all # full recursive build including desktop/mobile
```
## Workspace Package Overview
@@ -44,7 +45,8 @@ pnpm dev # build + run CLI entrypoint in dev mode
pnpm dev:ui # dashboard dev server only
pnpm lint # lint all packages
pnpm test # workspace test suite (clean-worktree compatible)
pnpm build # workspace builds
pnpm build # workspace builds (excludes desktop/mobile)
pnpm build:all # full workspace build (includes desktop/mobile)
pnpm verify:workspace # canonical lint -> test -> build verification gate
pnpm typecheck # workspace typechecks
```