Context
PR #353 (Vitest v4) added @peac/contracts and @peac/mappings-tap as root devDependencies to work around vitest v4's stricter module resolution. The surfaces/workers/_shared/core/ directory imports these packages via bare specifiers but is not itself a workspace package, so pnpm's strict isolation prevents resolution from that location.
The root devDep workaround anchors resolution via root node_modules, which works but is fragile -- someone could "clean up" these seemingly unnecessary root devDeps and re-break CI.
Proposed fix
Move surfaces/workers/_shared into a real workspace package (e.g. @peac/worker-shared) or merge it into the existing packages/worker-core. This restores "declared deps only" semantics and removes the need for root devDep workarounds.
Option A: New workspace package
- Create
packages/worker-shared/package.json with proper dependencies on @peac/contracts and @peac/mappings-tap
- Move
surfaces/workers/_shared/core/ contents there
- Update imports in worker packages (akamai, fastly, cloudflare)
- Remove root devDeps for
@peac/contracts and @peac/mappings-tap
Option B: Merge into worker-core
- Move shared types, errors, and verification logic from
_shared/core/ into packages/worker-core
- Update imports in worker packages
- Remove root devDeps
Notes
- Both
@peac/contracts and @peac/mappings-tap are needed (not just contracts)
- Worker tests (
pnpm test:core) exercise these imports and will catch regressions
- The deprecated
surfaces/_shared/contracts/ re-export layer should also be cleaned up
Context
PR #353 (Vitest v4) added
@peac/contractsand@peac/mappings-tapas root devDependencies to work around vitest v4's stricter module resolution. Thesurfaces/workers/_shared/core/directory imports these packages via bare specifiers but is not itself a workspace package, so pnpm's strict isolation prevents resolution from that location.The root devDep workaround anchors resolution via root
node_modules, which works but is fragile -- someone could "clean up" these seemingly unnecessary root devDeps and re-break CI.Proposed fix
Move
surfaces/workers/_sharedinto a real workspace package (e.g.@peac/worker-shared) or merge it into the existingpackages/worker-core. This restores "declared deps only" semantics and removes the need for root devDep workarounds.Option A: New workspace package
packages/worker-shared/package.jsonwith proper dependencies on@peac/contractsand@peac/mappings-tapsurfaces/workers/_shared/core/contents there@peac/contractsand@peac/mappings-tapOption B: Merge into worker-core
_shared/core/intopackages/worker-coreNotes
@peac/contractsand@peac/mappings-tapare needed (not just contracts)pnpm test:core) exercise these imports and will catch regressionssurfaces/_shared/contracts/re-export layer should also be cleaned up