Skip to content

#213 Create shared DTOs package for lambdas#234

Open
nourshoreibah wants to merge 3 commits into
mainfrom
shared-dtos-package
Open

#213 Create shared DTOs package for lambdas#234
nourshoreibah wants to merge 3 commits into
mainfrom
shared-dtos-package

Conversation

@nourshoreibah

@nourshoreibah nourshoreibah commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add shared types for auth DTOs and DB models via new, shared types backage

closes #213

Test plan

  • npm install + tsc build pass in all 6 lambdas
  • Type resolution verified (DB row types are real types, not any)
  • Compiled dist/ contains no runtime reference to @branch/dtos
  • init-handler scaffold includes the new dependency
  • Lambda tests green in CI
  • Exercise the regenerate-db-types workflow on a schema change

nourshoreibah and others added 3 commits June 9, 2026 20:18
Replaces the per-lambda copies of db-types.d.ts and the duplicated auth
DTO interfaces with a single types-only package in shared/dtos, installed
in every lambda via a file: dependency. Since the package ships only .d.ts
files, imports are erased at compile time and the deployed lambda.zip
artifacts remain fully self contained. The lambda CLI now adds the package
to new handlers, and the regenerate-db-types workflow writes the generated
types into shared/dtos instead of copying them into each lambda. The unused
shared git submodule is replaced by a regular directory.

Co-authored-by: Cursor <cursoragent@cursor.com>
The package mostly contains kysely DB row types (closer to ORM models
than DTOs), so name it for what it holds: shared/types exporting
@branch/types.

Co-authored-by: Cursor <cursoragent@cursor.com>
Coerce isAdmin to a boolean when building AuthorizationCheck mocks so
allowed is always boolean, matching the shared type definition.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nourshoreibah nourshoreibah marked this pull request as ready for review June 10, 2026 00:28
github-actions Bot added a commit that referenced this pull request Jun 10, 2026
@nourshoreibah nourshoreibah changed the title Create shared DTOs package for lambdas #213 Create shared DTOs package for lambdas Jun 10, 2026
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.

Backend refactoring 1: Create shared packages instead of duplicated DTOs

1 participant