fix(express,cloudflare): move @atxp/server to peerDependencies#142
Closed
fix(express,cloudflare): move @atxp/server to peerDependencies#142
Conversation
Move @atxp/server from dependencies to peerDependencies in both @atxp/express and @atxp/cloudflare. This prevents duplicate instances of @atxp/server when consumers also depend on it directly. The previous design bundled @atxp/server as a regular dependency, which meant npm would install a nested copy if the consumer had a different version. Since @atxp/server uses module-level state for ATXP context (account ID, token, config), two copies means the context set up by express middleware is invisible to the consumer's code — causing 'Authenticated user is required' errors. With peerDependencies, npm installs a single shared copy, and the consumer controls the version. Bump @atxp/express and @atxp/cloudflare to 0.10.8. Linear-issue: ATXP-1712
Contributor
Author
|
Closing — moving to peerDependencies would break existing consumers. Will implement getBalance locally in the image service instead. |
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
@atxp/expressbundles@atxp/serveras a regular dependency. When a consumer also depends on@atxp/serverdirectly, npm installs two copies with separate module-level state — the ATXP context set by express is invisible to the consumer's imports.Fix
Move
@atxp/serverfromdependenciestopeerDependenciesin@atxp/expressand@atxp/cloudflare. Bump both to0.10.8.Migration
Consumers need to add
@atxp/serveras a direct dependency:Linear-issue: ATXP-1712