-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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.jsonwith proper dependencies on@peac/contractsand@peac/mappings-tap - Move
surfaces/workers/_shared/core/contents there - Update imports in worker packages (akamai, fastly, cloudflare)
- Remove root devDeps for
@peac/contractsand@peac/mappings-tap
Option B: Merge into worker-core
- Move shared types, errors, and verification logic from
_shared/core/intopackages/worker-core - Update imports in worker packages
- Remove root devDeps
Notes
- Both
@peac/contractsand@peac/mappings-tapare 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