fix: declare effect as a peer dependency in published packages#876
Open
aryasaatvik wants to merge 1 commit into
Open
fix: declare effect as a peer dependency in published packages#876aryasaatvik wants to merge 1 commit into
aryasaatvik wants to merge 1 commit into
Conversation
effect requires a single module instance for Context/service identity and type equality. Declaring it as a hard dependency causes duplicate effect copies when a consumer pins a different 4.0.0-beta.x, breaking service resolution and surfacing as TypeScript reporting the two effect copies as incompatible. Move effect to peerDependencies (with a devDependencies mirror) in the 12 published library packages. The executor CLI and private workspace packages keep effect as a regular dependency.
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.
Problem
The published
@executor-js/*packages declareeffectas a harddependency. Sinceeffectneeds a single module instance forContext/service identity and type equality, a consumer pinning a different4.0.0-beta.xends up with a duplicatedeffect— services stop resolving, and TypeScript flags the two copies as incompatible.Fix
Move
effectfromdependencies→peerDependencies(with adevDependenciesmirror) in the 12 published library packages, so the consumer supplies the single shared instance. Matches howreact/@effect/atom-reactare already declared as peers.The
executorCLI (leaf binary) and private workspace packages keepeffectas a regular dependency.Verification
bun install→ singleeffect@4.0.0-beta.59turbo run typecheck→ 34/34 passbun pm packon@executor-js/sdk→effectunderpeerDependencies, notdependencies