Speed up turbo, package.json scripts, and CI configuration

Merged
PI
9mo ago
+984-930

why

what changed

test plan


Summary by cubic

Speed up builds and tests by upgrading Turborepo, tightening cache keys, and refactoring scripts to run from compiled dist (ESM/CJS). CI is faster and more reliable, with ESM-first SEA builds for the server.

  • Refactors

    • Upgrade Turborepo to 2.8.10 and rewrite turbo.json with explicit inputs/outputs for better caching.
    • Stronger Turbo cache keys in CI (lockfiles + workspace + package.json + turbo.json + commit), workflow-scoped concurrency, and a 60s session create timeout.
    • Standardized CI via a composite setup action; build now runs before lint.
    • Build/test scripts resolve the repo root via fileURLToPath; tests run from compiled dist; add Vitest config for CJS; CJS builds include sourcemaps.
    • Server: ESM-first SEA build and split server build into dist vs SEA steps with a new build:server:dist script.
    • Unified test scripts across packages; top-level test runs all suites, and evals tests support source or dist CLI via --cli.
  • Migration

    • Use Node 20.19+ or 22.12+ (enforced in core).
    • Run pnpm install to pick up the Turbo upgrade.
    • Build before tests: pnpm -w build. For SEA tests, also run pnpm -w --filter=@browserbasehq/stagehand-server run build:sea:esm.