fix(examples): emit generated contract into tracked src/prisma (TML-2722)#618
Conversation
|
Warning Review limit reached
More reviews will be available in 2 minutes and 45 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…radedb-demo and prisma-next-demo-sqlite Set outputPath to ./src/prisma so emit writes contract.json and contract.d.ts next to db.ts while contract.ts stays under prisma/. Added outputPath to the sqlite defineConfig facade for parity with postgres/mongo. Refs: TML-2722 Signed-off-by: Will Madden <madden@prisma.io>
fdc2a7d to
243b36e
Compare
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/extension-cipherstash
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
…istory Replace the three synthetic normal-shape golden cases with cases drawn from real merged PRs, so the corpus measures Drive runs against work the team actually shipped rather than synthesised tasks: - direct-change-example-emit-outputpath (TML-2722 / #618) - slice-dedupe-generated-imports (TML-2714 / #614) - project-reap-subsumed-ir-surfaces (TML-2727 / #630, #631, #629) — a three-slice parallel fan-out that exercises planner parallelisation and scope discipline. Each real case carries the task as posed (Linear ticket, solution-scrubbed so the run still does the design/planning), a base_sha to run against, and a reference.md describing the known-good output by commit SHA (the output itself is fetchable via git diff <base_sha> <merge_sha>). case.json gains source + base_sha; the loader ignores the extra fields until the experiment-engine slice wires base_sha into a checkout. The two pathological cases (i12-halt, spike-first) stay synthetic: no clean merged PR exhibits a halted or spiked run. Update harness tests, SKILL.md examples, and the corpus README for the renamed slugs. validate-parser fixtures are left as-is — they are synthetic parser fixtures with tuned event counts, not corpus members. Signed-off-by: wmadden-electric <286902546+wmadden-electric@users.noreply.github.com>
At a glance
paradedb-demoandprisma-next-demo-sqliteimport their generated contract fromsrc/prisma/, butprisma-next contract emitwas writing toprisma/. The one-line config fix, per example:Before, every emit dropped stray untracked
prisma/contract.{d.ts,json}files while the trackedsrc/prisma/copies were never regenerated (kept current only by manual copying — which is exactly how two authoring sources got accidentally deleted during TML-2714).The decision
Point each example's emit
outputPathat the tracked location (src/prisma), so emit regenerates the canonical files in place and produces no stray output. The authoring source stays atprisma/contract.ts; the app's import path is unchanged.How we got here
In the family
defineConfigshorthand,contract: './prisma/contract.ts'drove both the authoring source path and — viaderiveOutputPath()— the default emit output (./prisma/contract.json). Since the apps actually consumesrc/prisma/(next todb.ts), emit and the tracked artifacts had diverged. SettingoutputPathexplicitly decouples the two.One parity gap surfaced:
@prisma-next/sqlite'sdefineConfigdidn't acceptoutputPath(postgres and mongo already did), so the sqlite example couldn't be fixed config-only. This adds it, mirroring postgres, with tests.The change
examples/paradedb-demo+examples/prisma-next-demo-sqlite: addoutputPath: './src/prisma'.@prisma-next/sqlitedefineConfig: acceptoutputPath(mirrors postgres) + tests.prisma/contract.{d.ts,json}from both examples. No tracked-artifact diffs —src/prisma/was already in sync.Verification
pnpm buildpnpm fixtures:check(clean; a secondfixtures:emitleaves the tree clean — no strayprisma/artifacts)pnpm --filter paradedb-demo typecheck·pnpm --filter prisma-next-demo-sqlite typecheck@prisma-next/sqliteconfig tests (40) ·pnpm lint:depsAlternatives considered
contract.tsintosrc/prisma/and colocate everything. Rejected: larger churn that changes the authoring layout these examples deliberately use (authoring inprisma/, generated + wiring insrc/prisma/), for no functional gain.outputPath) and keeps the manual-sync fragility.Refs: TML-2722. Surfaced during TML-2714.