Commit 59e0db9
feat: migrate prisma from v6 to v7
* chore(db): update prisma schema for v7 (provider, output, remove url)
* chore(db): rewrite prisma.config.ts for v7 stable API
* chore(db): update client/index to use generated prisma-client path
* chore(db): bump prisma to v7, add adapter-pg, update scripts and dist templates
* chore(db): update postinstall sentinel for prisma-client output path
* chore(db): add previewFeatures postgresqlExtensions to generator for prisma v7 compat
* chore(auth): replace PrismaClient import with PrismaLike structural type for prisma v7
- Remove @prisma/client import and peerDependency
- Replace PrismaClient type with PrismaLike interface (duck typing)
- Make CreateAuthServerOptions generic with TDb extends PrismaLike
- Define PrismaLike with $connect, $disconnect, and organization model methods
- Removes direct coupling to @prisma/client for Prisma v7 custom output compatibility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(auth): simplify PrismaLike to minimal structural interface
* chore(api): add patch-schema-generator script for prisma-client-js in v7
* chore(api): unignore patch-schema-generator.js from scripts gitignore
* chore(api): update prisma config, client, index for v7 + add adapter-pg
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: prisma PrismaPg constructor requires PoolConfig object, not raw string
* chore(api): fix patch-schema to include postgresqlExtensions previewFeature and add prisma/generated to gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(api): migrate @trycompai/db imports to @db
* chore(api): migrate @prisma/client imports to @db
* fix(api): use default prisma-client-js output to resolve dist/ module issue
prisma-client-js without custom output generates to node_modules/@prisma/client,
which Node.js resolves from any directory. This avoids the ./generated import
that fails at runtime because tsc doesn't copy .js files to dist/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore(app): update prisma to v7 (schema, config, client, remove monorepo plugin)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(app): migrate @trycompai/db and @prisma/client imports to @db
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore(portal): update prisma to v7 (schema, config, client, imports)
- Switch generator from prisma-client-js to prisma-client with output to src/generated/prisma
- Add prisma.config.ts with defineConfig + env datasource URL
- Update client.ts to use PrismaPg adapter with PoolConfig pattern
- Update index.ts to re-export from generated client
- Add @prisma/adapter-pg 7.6.0 and bump @prisma/client + prisma to 7.6.0
- Add src/generated/ to .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(api): update Dockerfile for prisma v7 (patch step, remove openssl)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(ci): add schema patch step to trigger.dev deploy workflows for prisma v7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: bump @prisma/adapter-pg to 7.6.0 at root
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(framework-editor): bump prisma to v7, add prisma.config.ts
* fix(db): update seed script to use PrismaPg adapter instead of removed datasourceUrl
* fix(app): split prisma exports into browser-safe types and server-only db
prisma-client v7's PrismaPg adapter imports pg which requires dns (Node.js only).
Client components importing types from @db would pull in the entire server chain.
Fix: @db now exports from browser.ts (types/enums only), @db/server exports
the db instance and full client types. 102 server files migrated to @db/server.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(app): migrate remaining multi-line db import to @db/server
* fix(db): dist templates use ../src/generated path and browser.ts for types
* fix(db): remove db export from dist/index and use browser.ts for all barrel exports
* fix(db): point exports to src/index.ts, use browser.ts for barrel export
* fix(app): add resolveExtensions to turbopack for .js→.ts resolution in generated prisma files
* fix: add post-generate script to rewrite .js→.ts imports in prisma generated files
* fix(db): remove db export from index.ts — server-only, must be imported from client.ts directly
* fix(db): add .ts extension to browser import for Node.js ESM resolution
* fix(db): keep .js extensions in packages/db for tsc compat, only fix for Turbopack apps
* fix(db): use combined schema (dist/schema.prisma) for prisma generate to include all models and enums
* fix(app): migrate remaining db and Prisma imports to @db/server
* perf(db): re-export from @prisma/client, skip compiling generated files in build
@prisma/client has browser-safe exports with all enums and proper
browser/server conditions. No need to compile hundreds of generated
.ts files to dist/ — build goes from 6+ min in Docker to ~3s.
* perf(db): fast build — generate prisma-client-js to @prisma/client, skip tsc of generated files
* fix: add @trycompai/db to db:generate filter, use generate-prisma-client-js in db:generate
* fix(app): update trigger.dev config and custom prisma extension for v7
* fix(api): update trigger.dev config and custom prisma extension for v7
* fix: change @trycompai/db from npm pinned version to workspace:* across all packages
* fix(portal): split prisma exports into browser-safe types and server-only db
* fix(framework-editor): update prisma client for v7, add adapter-pg, split browser/server exports
* fix(portal): use session cookies instead of JWT for API calls (API supports cookies via HybridAuthGuard)
* fix(portal): remove unnecessary X-Organization-Id header, API gets it from session
* fix(api): add localhost:3008 (trust app) to CORS trusted origins
* fix(api): update jest mocks from @trycompai/db to @db, add missing @db mocks for test files
* chore: commit pre-existing spec and openapi changes
* fix: address bugbot issues (test mocks, duplicate mocks, build:docker prisma step)
- policies.controller.spec.ts: change require('@trycompai/db') to require('@db') to match the mocked module
- invitations route.test.ts: change vi.mock('@db') to vi.mock('@db/server') to match the import in the test
- risks/comments/devices controller specs: remove duplicate jest.mock('@db') blocks, keeping one per file
- apps/app/package.json: add fix-generated-extensions.js step to build:docker script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: add db:generate task dependency to prevent race condition in Vercel builds
* chore: update bun.lock
* fix(db): import PrismaClient from @prisma/client in src/client.ts (matches build output)
* fix(portal): migrate fleet-policies route db import to @db/server
* fix: remove duplicate jest.mock, fix fragile prisma-client regex in trigger extensions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: scope sed output deletion to generator directive only (prevents deleting model fields)
* fix: prevent PrismaPg adapter pool leak during dev hot-reload
* fix(app): import Prisma from @db/server in connect-cloud action
* fix(api): migrate new @trycompai/db imports from merged PR to @db
* fix: make schema patching surgical (replace provider + remove output only, preserve other settings)
---------
Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 30516d4 commit 59e0db9
304 files changed
Lines changed: 810 additions & 493 deletions
File tree
- .github/workflows
- apps
- api
- prisma
- scripts
- src
- admin-organizations
- dto
- assistant-chat
- audit
- auth
- browserbase
- cloud-security
- comments
- context
- controls
- device-agent
- devices
- evidence-forms
- finding-template
- findings
- dto
- framework-editor
- control-template
- framework
- dto
- policy-template
- dto
- requirement
- task-template
- dto
- frameworks
- integration-platform
- controllers
- interceptors
- repositories
- services
- org-chart
- organization
- people
- dto
- utils
- policies
- risks
- dto
- roles
- secrets
- security-penetration-tests
- task-management
- tasks
- automations
- evidence-export
- training
- trigger
- policies
- vendor
- trust-portal
- dto
- utils
- vendors
- dto
- test
- app
- prisma
- src
- actions
- files
- organization
- lib
- people
- policies
- app
- (app)
- [orgId]
- cloud-tests/actions
- frameworks
- data
- lib
- people
- [employeeId]
- actions
- all
- actions
- components
- dashboard/components
- devices/data
- policies/[policyId]
- actions
- editor/actions
- security/penetration-tests
- [reportId]
- settings
- portal
- tasks/[taskId]/automation/[automationId]
- actions
- trust/portal-settings/actions
- vendors
- [vendorId]
- actions
- components
- backup-overview/components/charts
- invite/[code]
- onboarding
- [orgId]
- actions
- setup/actions
- upgrade/[orgId]
- api
- auth
- test-db
- test-grant-access
- test-login
- email-preferences
- get-image-url
- health
- invitations/[id]
- policies/[policyId]/chat
- qa
- approve-org
- delete-user
- retool/reset-org
- training/certificate
- user-frameworks
- webhooks/stripe-pentest
- unsubscribe
- preferences
- components
- policies/charts
- risks/charts
- hooks
- lib
- db
- vector/sync
- trigger/tasks
- auditor
- device
- email
- integration
- onboarding
- scrape
- task
- framework-editor
- prisma
- portal
- prisma
- src
- actions
- app
- (app)/(home)
- [orgId]
- components
- documents/[formType]
- submissions
- policy/[policyId]
- components
- api
- confirm-fleet-policy
- download-agent
- fleet-policies
- fleet-policy
- portal
- accept-policies
- mark-policy-completed
- policy-pdf-url
- packages
- auth
- src
- company
- db
- prisma
- seed
- scripts
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments