Skip to content

chore: promote surfaces/workers/_shared to workspace (#355)#404

Merged
jithinraj merged 5 commits intomainfrom
chore/promote-worker-shared
Feb 21, 2026
Merged

chore: promote surfaces/workers/_shared to workspace (#355)#404
jithinraj merged 5 commits intomainfrom
chore/promote-worker-shared

Conversation

@jithinraj
Copy link
Copy Markdown
Member

Summary

  • Moved surfaces/workers/_shared/core/ into packages/worker-shared/ as a private workspace package (@peac/worker-shared)
  • Updated all 3 worker surfaces (cloudflare, akamai, fastly) to import from @peac/worker-shared instead of relative ../../_shared/core/ paths
  • Removed @peac/contracts and @peac/mappings-tap from root devDependencies (no longer needed as workaround)
  • Deleted surfaces/workers/_shared/ and surfaces/_shared/contracts/ (deprecated re-export layer)

Closes #355

Problem

surfaces/workers/_shared/core/ imports @peac/contracts and @peac/mappings-tap via bare specifiers but is not a workspace package. Vitest v4 strict mode requires a fragile root devDep workaround.

Solution

Create @peac/worker-shared as a private workspace package (packages/worker-shared/). The package:

  • Is private: true (never published to npm)
  • Has @peac/contracts and @peac/mappings-tap as proper dependencies
  • Exports the same API as the old _shared/core/index.ts
  • Is Layer 4 (imports from L3 contracts + L4 mappings-tap)

Changes

Action Path Details
CREATE packages/worker-shared/ Private workspace package
MOVE surfaces/workers/_shared/core/*.ts -> packages/worker-shared/src/ 6 files (config, errors, hash, index, types, verification)
MODIFY surfaces/workers/{cloudflare,akamai,fastly}/src/*.ts Import path ../../_shared/core/index.js -> @peac/worker-shared
MODIFY surfaces/workers/{cloudflare,akamai,fastly}/package.json Add @peac/worker-shared: workspace:* dependency
MODIFY Root package.json Remove @peac/contracts and @peac/mappings-tap from devDependencies
DELETE surfaces/workers/_shared/ Replaced by packages/worker-shared
DELETE surfaces/_shared/contracts/ Deprecated re-export layer, unused

Verification

  • pnpm build -- 75/75 targets
  • pnpm test -- 4136/4136 tests
  • pnpm test:core -- worker tests pass
  • Zero _shared/core references remaining in surfaces
  • pnpm install --frozen-lockfile resolves correctly

Test plan

  • Build passes (75/75)
  • All tests pass (4136/4136)
  • Worker surfaces resolve @peac/worker-shared correctly
  • No root devDep workarounds remain
  • Old _shared directories deleted

@jithinraj jithinraj force-pushed the chore/promote-worker-shared branch 2 times, most recently from def53ff to a48685d Compare February 21, 2026 20:54
Move surfaces/workers/_shared/core/ into packages/worker-shared/ as a
private workspace package (@peac/worker-shared). This eliminates the
Vitest v4 strict mode workaround that required root devDeps for
@peac/contracts and @peac/mappings-tap.

- Created packages/worker-shared/ (private, not published)
- Updated all 3 worker surfaces (cloudflare, akamai, fastly) to import
  from @peac/worker-shared instead of relative ../../_shared/core/
- Removed @peac/contracts and @peac/mappings-tap from root devDeps
- Deleted surfaces/workers/_shared/ and surfaces/_shared/contracts/
Convert @peac/worker-shared to a dist-built workspace package:
- Point main/types/exports to dist/ (matching @peac/privacy pattern)
- Add build, typecheck, clean scripts + typescript devDep
- Add sideEffects: false
- Add path alias in tsconfig.base.json for TS resolution

Fix prettier formatting on 4 surface worker files.
Dist-built exports broke ESM resolution chain for transitive deps
(@peac/mappings-tap exports). Source exports are the correct pattern
for private workspace-only packages that are never published to npm.

- Restore "type": "module" for ESM resolution
- Point main/types/exports to ./src/index.ts
- Override composite: false (avoids TS6307 with path aliases)
- Remove dist-related scripts and devDependencies
Source-exports package has no build artifacts, so clean is a no-op.
Uses node -e for cross-platform compatibility.
@jithinraj jithinraj force-pushed the chore/promote-worker-shared branch from a48685d to 76ac2b8 Compare February 21, 2026 21:02
@jithinraj jithinraj changed the title chore: promote surfaces/workers/_shared to workspace package (#355) chore: promote surfaces/workers/_shared to workspace (#355) Feb 21, 2026
@jithinraj jithinraj merged commit 04da28a into main Feb 21, 2026
7 checks passed
@jithinraj jithinraj deleted the chore/promote-worker-shared branch February 24, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: promote surfaces/workers/_shared to workspace package

1 participant