chore: promote surfaces/workers/_shared to workspace (#355)#404
Merged
chore: promote surfaces/workers/_shared to workspace (#355)#404
Conversation
def53ff to
a48685d
Compare
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.
a48685d to
76ac2b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
surfaces/workers/_shared/core/intopackages/worker-shared/as a private workspace package (@peac/worker-shared)@peac/worker-sharedinstead of relative../../_shared/core/paths@peac/contractsand@peac/mappings-tapfrom rootdevDependencies(no longer needed as workaround)surfaces/workers/_shared/andsurfaces/_shared/contracts/(deprecated re-export layer)Closes #355
Problem
surfaces/workers/_shared/core/imports@peac/contractsand@peac/mappings-tapvia bare specifiers but is not a workspace package. Vitest v4 strict mode requires a fragile root devDep workaround.Solution
Create
@peac/worker-sharedas a private workspace package (packages/worker-shared/). The package:private: true(never published to npm)@peac/contractsand@peac/mappings-tapas properdependencies_shared/core/index.tsChanges
packages/worker-shared/surfaces/workers/_shared/core/*.ts->packages/worker-shared/src/surfaces/workers/{cloudflare,akamai,fastly}/src/*.ts../../_shared/core/index.js->@peac/worker-sharedsurfaces/workers/{cloudflare,akamai,fastly}/package.json@peac/worker-shared: workspace:*dependencypackage.json@peac/contractsand@peac/mappings-tapfrom devDependenciessurfaces/workers/_shared/surfaces/_shared/contracts/Verification
pnpm build-- 75/75 targetspnpm test-- 4136/4136 testspnpm test:core-- worker tests pass_shared/corereferences remaining in surfacespnpm install --frozen-lockfileresolves correctlyTest plan
@peac/worker-sharedcorrectly_shareddirectories deleted