Commit a27bc43
chore(db): publish flattened dist/schema.prisma for external consumers (#2677)
The native v7 multi-file schema refactor (c58045f) removed the legacy
combine-schemas step that produced a single-file schema in dist/. That
worked inside the monorepo (apps read prisma/schema/ directly), but
broke external consumers like comp-private's enterprise-api/cx-dashboard/
framework-editor/trust apps, which all run
cp ../../node_modules/@trycompai/db/dist/schema.prisma prisma/schema.prisma
at build time. The 2.0.1 publish was the first to consume the post-
refactor build, and shipped without dist/schema.prisma — breaking every
consumer's db:getschema script and blocking SALE-49's comp-private PR.
Add scripts/build-dist-schema.js: concatenates prisma/schema/*.prisma
(schema.prisma generator+datasource first, models alphabetically after)
into dist/schema.prisma during build. Output matches the v2.0.0 shape
exactly so consumers don't need to change. Wire into the build script
after tsc.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 32b210e commit a27bc43
2 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| 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 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments