Skip to content

chore: promote surfaces/workers/_shared to workspace package #355

@jithinraj

Description

@jithinraj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions