refactor(express): take messaging types from core - #122
Merged
Merged
Conversation
packages/express/src/messaging.ts was byte-identical to packages/core/src/authMessaging.ts, so every messaging type was declared twice with nothing to keep the copies in step. Delete the express copy and point the re-exports and internal importers at @seamless-auth/core, matching the pattern already used for SeamlessUser, hasScopedRole, and roleGrantsAccess. The package root exports the same type names as before, and the deleted module was never reachable on its own because the package declares only a root export. Closes #118
6 tasks
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.
Closes #118
Problem
packages/express/src/messaging.tsandpackages/core/src/authMessaging.tswere byte-identical, 114 lines each. Every messaging type was declared twice, and the two copies could drift without anything failing.Change
Delete the express copy and point everything at
@seamless-auth/core, matching the pattern already insrc/index.tsforSeamlessUser,hasScopedRole, androleGrantsAccess:src/index.ts: the messaging type re-exports now come from@seamless-auth/core, folded into the existingSeamlessUserre-export.src/createServer.ts:SeamlessAuthMessagingOptionsimported from core.src/internal/deliverAuthMessage.ts:AuthDeliveryInstruction,EmailMessage,SeamlessAuthMessagingOptions, andSmsMessageimported from core.No public surface change
Verified rather than assumed. Clean-built the emitted
.d.tsonmainand on this branch and diffed them. The only differences are the module specifier the types are re-exported from; the set of exported names is unchanged:dist/messaging.d.tsis gone, but it was never reachable by adopters: the package declares only a root.export, no subpaths.@seamless-auth/coreis already a realdependenciesentry, so the types resolve for consumers.The types the adapter and core share are now one declaration rather than two structurally identical ones.
Not in scope
The issue's "Related" note suggests core could take the pure data shapes from
@seamless-auth/typesinstead of declaring them. That overlaps #120 and is left for a separate PR. Worth knowing before that one is picked up: the role module is not in the published@seamless-auth/types@0.1.3, so #120 is blocked on a release from that repo.Checks
pnpm buildclean.pnpm testpasses: 43 suites, 205 tests. Patch changeset added for@seamless-auth/express.