Skip to content

refactor: align auth types with @wxyc/shared#209

Open
jakebromberg wants to merge 3 commits intomainfrom
refactor/shared-auth-types
Open

refactor: align auth types with @wxyc/shared#209
jakebromberg wants to merge 3 commits intomainfrom
refactor/shared-auth-types

Conversation

@jakebromberg
Copy link
Member

Summary

  • Add @wxyc/shared dependency and re-export WXYCRole, Authorization, and roleToAuthorization from the shared package
  • Add compile-time assertion that local roles are valid shared roles
  • Introduce ImplementedRole type for roles with better-auth access control implementations
  • Set up .npmrc and CI NPM_TOKEN for GitHub Packages authentication

Closes #208

Test plan

  • All 49 auth unit tests pass (4 test suites)
  • New compatibility test verifies WXYCRoles alignment with shared types
  • Full typecheck passes across all workspaces
  • Full build succeeds (ESM + CJS)
  • Verify NPM_TOKEN secret exists in Backend-Service repo settings (required for CI)

Jake Bromberg added 3 commits February 26, 2026 14:05
Add @wxyc/shared as a dependency and re-export WXYCRole,
Authorization, and roleToAuthorization from the shared package.
This ensures a single source of truth for auth types across
the stack.

Changes:
- Add .npmrc for GitHub Packages registry authentication
- Add @wxyc/shared to shared/authentication dependencies
- Re-export WXYCRole type from shared (replaces local definition)
- Add compile-time assertion that local roles are valid shared roles
- Introduce ImplementedRole type for roles with better-auth impls
- Add NPM_TOKEN env to all CI install steps
- Add @wxyc/shared to jest transform and tsup externals
- Add shared type compatibility tests
- Fix lint error: replace non-null assertion with proper guard
- Suppress no-unused-vars warning on compile-time assertion
- Pass NPM_TOKEN build arg to Docker builds for @wxyc/shared
- Copy .npmrc into Docker images, remove from production stage
- Format test file with Prettier
- Pass NPM_TOKEN build-arg in workspace docker:build scripts
- Add NPM_TOKEN env to Set Up Test Environment CI step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align auth types with @wxyc/shared

1 participant