Skip to content

Conversation

@borisno2
Copy link
Member

Summary

  • Add CreateManyArgs and UpdateManyArgs types for each list in the generated types
  • Add createMany and updateMany methods to CustomDB type with proper generic typing
  • Fix hook types to use locally defined BaseContext instead of importing AccessContext from core

This completes the type support for createMany and updateMany operations that were added to context.db in PR #315 but were missing from the type generator.

Changes

New Args Types

CreateManyArgs - for bulk create operations:

export type PostCreateManyArgs = {
  data: Prisma.PostCreateInput[]
  select?: PostSelect | null
  include?: PostInclude | null  // only if list has relationships
}

UpdateManyArgs - for bulk update operations:

export type PostUpdateManyArgs = {
  where?: PostWhereInput
  data: Prisma.PostUpdateInput
  select?: PostSelect | null
  include?: PostInclude | null  // only if list has relationships
}

CustomDB Type Updated

Both methods are now properly typed in the CustomDB interface:

createMany: <T extends PostCreateManyArgs>(
  args: Prisma.SelectSubset<T, PostCreateManyArgs>
) => Promise<Array<PostGetPayload<T>>>

updateMany: <T extends PostUpdateManyArgs>(
  args: Prisma.SelectSubset<T, PostUpdateManyArgs>
) => Promise<Array<PostGetPayload<T>>>

Hook Context Fix

Changed hook types from using import('@opensaas/stack-core').AccessContext to using the locally defined BaseContext, which has the properly typed CustomDB with virtual fields, createMany, updateMany, etc.

Test plan

  • All existing tests pass
  • Snapshot tests updated to reflect new types
  • Build succeeds for all packages and examples
  • Generated types compile correctly

🤖 Generated with Claude Code

- Add CreateManyArgs and UpdateManyArgs types for each list
- Add createMany and updateMany methods to CustomDB type
- Fix hook types to use locally defined BaseContext instead of
  importing AccessContext from core, giving hooks access to properly
  typed CustomDB with virtual fields and all operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
stack-docs Ready Ready Preview, Comment Dec 28, 2025 9:12am

@changeset-bot
Copy link

changeset-bot bot commented Dec 28, 2025

🦋 Changeset detected

Latest commit: 90c5459

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@opensaas/stack-cli Minor
@opensaas/stack-auth Minor
@opensaas/stack-core Minor
@opensaas/stack-rag Minor
@opensaas/stack-storage-s3 Minor
@opensaas/stack-storage-vercel Minor
@opensaas/stack-storage Minor
@opensaas/stack-tiptap Minor
@opensaas/stack-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@borisno2 borisno2 enabled auto-merge (squash) December 28, 2025 09:14
@borisno2 borisno2 merged commit a05db98 into main Dec 28, 2025
6 checks passed
@github-actions
Copy link
Contributor

Coverage Report for Core Package Coverage (./packages/core)

Status Category Percentage Covered / Total
🔵 Lines 85.19% 443 / 520
🔵 Statements 84.48% 452 / 535
🔵 Functions 97.22% 70 / 72
🔵 Branches 72.83% 319 / 438
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for UI Package Coverage (./packages/ui)

Status Category Percentage Covered / Total
🔵 Lines 76.03% 92 / 121
🔵 Statements 75.39% 95 / 126
🔵 Functions 75.6% 31 / 41
🔵 Branches 65.78% 75 / 114
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for CLI Package Coverage (./packages/cli)

Status Category Percentage Covered / Total
🔵 Lines 78.46% 1137 / 1449
🔵 Statements 78.07% 1179 / 1510
🔵 Functions 84.53% 153 / 181
🔵 Branches 68.43% 516 / 754
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/generator/types.ts 93.34% 79.41% 93.33% 94.39% 11, 21, 30, 40, 68, 103-106, 146, 193, 233, 250, 351-355, 420-424, 459, 512, 863, 927-942, 950-954, 981-983
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Auth Package Coverage (./packages/auth)

Status Category Percentage Covered / Total
🔵 Lines 64.49% 89 / 138
🔵 Statements 61.03% 94 / 154
🔵 Functions 74.46% 35 / 47
🔵 Branches 62.79% 54 / 86
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage Package Coverage (./packages/storage)

Status Category Percentage Covered / Total
🔵 Lines 42.44% 73 / 172
🔵 Statements 42.77% 74 / 173
🔵 Functions 42.85% 15 / 35
🔵 Branches 40.13% 61 / 152
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for RAG Package Coverage (./packages/rag)

Status Category Percentage Covered / Total
🔵 Lines 47.97% 355 / 740
🔵 Statements 48.14% 377 / 783
🔵 Functions 54.26% 70 / 129
🔵 Branches 42.55% 180 / 423
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)

Status Category Percentage Covered / Total
🔵 Lines 100% 40 / 40
🔵 Statements 100% 40 / 40
🔵 Functions 100% 9 / 9
🔵 Branches 100% 19 / 19
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)

Status Category Percentage Covered / Total
🔵 Lines 100% 38 / 38
🔵 Statements 100% 38 / 38
🔵 Functions 100% 8 / 8
🔵 Branches 100% 22 / 22
File CoverageNo changed files found.
Generated in workflow #849 for commit 90c5459 by the Vitest Coverage Report Action

@github-actions github-actions bot mentioned this pull request Dec 28, 2025
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.

2 participants