chore: split the client core into @seamless-auth/client as an npm workspace - #149
Merged
Conversation
…kspace @seamless-auth/react was one package holding two layers: the headless client, session store and result types any binding needs, and the React provider, hooks and screens on top. A React Native binding is next and must share the first layer rather than copy it, since the session state machine is the worst place for two implementations to drift (#64). packages/client publishes @seamless-auth/client with createSeamlessAuthClient, createAuthSession, the storage port, createFetchWithAuth, the error and result types, the PRF helpers, role matching and the wire type aliases. packages/react depends on it and re-exports the same public surface it did before. Tests run as one Jest project per package from the root; the React project maps the client package to its source so a core change is exercised without a build. Packaging only: no runtime behaviour changes in either package.
This was referenced Sep 13, 2026
13 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.
Summary
Phase 3 of #64 (workspace conversion), pulled forward because a React Native binding is next (fells-code/seamless-templates#40) and it must share the client core rather than copy it.
packages/client→@seamless-auth/client(new, 0.1.0 on release):createSeamlessAuthClient,createAuthSession,SessionStoragePort+ implementations,createFetchWithAuth, error and result types, PRF helpers, role matching, wire type aliases. Lint-enforced: no React, router, or React Native imports, and no imports from a binding package.packages/react→@seamless-auth/react(patch): depends on@seamless-auth/clientand re-exports the same public surface as before. No runtime behaviour change.git mv, so history follows them.@seamless-auth/clientto the client source, so a core change is exercised by the React suite without a build in between;packages/react/tsconfig.jsoncarries the same mapping for type-checking andtsconfig.build.jsondrops it so emitted declarations reference the package by name.lint,test,build,typecheck,check-npm-build), soci.ymlandrelease.ymlrun unchanged;buildruns client before react explicitly.linked: []), client starts at 0.0.0 with aminorchangeset so the first publish is 0.1.0.AGENTS.mdarchitecture section rewritten for the workspace; new root README andpackages/client/README.md.Kept as a local copy rather than a re-export:
scopedRoles.ts.@seamless-auth/types/role/matchingonly declaresimport/typesexport conditions, which Jest 29 under jsdom cannot resolve (norequire/default), and any Jest-based consumer of the client bundle would hit the same. Worth adefaultcondition upstream; noted, not done here.Depends on
fells-code/seamless-cli#203:
seamless verify --localpacks the react checkout withnpm packat the repo root. With the workspace that produces the private root package, so the harness now packs-w @seamless-auth/client -w @seamless-auth/reactwhen it seesworkspaces. Theconformance.ymlcheck on this PR consumes that reusable workflow@main, so it will go green once #203 merges.Test plan
npm run lintcleannpm test: 327 passing across both projects, coverage 90.25 / 80.03 / 90.03 / 90.29npm run typecheckboth packagesnpm run buildboth packages; react bundle externals are@seamless-auth/client,libphonenumber-js,react,react-router-dom; client bundle external is@simplewebauthn/browsernpm run check-npm-build: both tarballs carry dist, README, CHANGELOG, LICENSEnpx changeset status: client minor, react patch