Skip to content

fix(examples): emit generated contract into tracked src/prisma (TML-2722)#618

Merged
wmadden merged 1 commit into
mainfrom
tml-2722-fix-example-emit-output-dir
May 29, 2026
Merged

fix(examples): emit generated contract into tracked src/prisma (TML-2722)#618
wmadden merged 1 commit into
mainfrom
tml-2722-fix-example-emit-output-dir

Conversation

@wmadden
Copy link
Copy Markdown
Contributor

@wmadden wmadden commented May 29, 2026

At a glance

paradedb-demo and prisma-next-demo-sqlite import their generated contract from src/prisma/, but prisma-next contract emit was writing to prisma/. The one-line config fix, per example:

// prisma-next.config.ts
export default defineConfig({
  contract: './prisma/contract.ts',
+ outputPath: './src/prisma',
});

Before, every emit dropped stray untracked prisma/contract.{d.ts,json} files while the tracked src/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 outputPath at the tracked location (src/prisma), so emit regenerates the canonical files in place and produces no stray output. The authoring source stays at prisma/contract.ts; the app's import path is unchanged.

How we got here

In the family defineConfig shorthand, contract: './prisma/contract.ts' drove both the authoring source path and — via deriveOutputPath() — the default emit output (./prisma/contract.json). Since the apps actually consume src/prisma/ (next to db.ts), emit and the tracked artifacts had diverged. Setting outputPath explicitly decouples the two.

One parity gap surfaced: @prisma-next/sqlite's defineConfig didn't accept outputPath (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: add outputPath: './src/prisma'.
  • @prisma-next/sqlite defineConfig: accept outputPath (mirrors postgres) + tests.
  • Removed the stray untracked prisma/contract.{d.ts,json} from both examples. No tracked-artifact diffs — src/prisma/ was already in sync.

Verification

  • pnpm build
  • pnpm fixtures:check (clean; a second fixtures:emit leaves the tree clean — no stray prisma/ artifacts)
  • pnpm --filter paradedb-demo typecheck · pnpm --filter prisma-next-demo-sqlite typecheck
  • @prisma-next/sqlite config tests (40) · pnpm lint:deps

Alternatives considered

  • Move the authoring contract.ts into src/prisma/ and colocate everything. Rejected: larger churn that changes the authoring layout these examples deliberately use (authoring in prisma/, generated + wiring in src/prisma/), for no functional gain.
  • Special-case a copy step in the fixtures tooling. Rejected: papers over the root cause (the misaligned outputPath) and keeps the manual-sync fragility.

Refs: TML-2722. Surfaced during TML-2714.

@wmadden wmadden requested a review from a team as a code owner May 29, 2026 10:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@wmadden, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8001dd61-b93e-4dc4-8889-bfc6b07aa795

📥 Commits

Reviewing files that changed from the base of the PR and between e15220b and 243b36e.

📒 Files selected for processing (4)
  • examples/paradedb-demo/prisma-next.config.ts
  • examples/prisma-next-demo-sqlite/prisma-next.config.ts
  • packages/3-extensions/sqlite/src/config/define-config.ts
  • packages/3-extensions/sqlite/test/config/define-config.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2722-fix-example-emit-output-dir

Comment @coderabbitai help to get the list of available commands and usage tips.

…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>
@wmadden wmadden force-pushed the tml-2722-fix-example-emit-output-dir branch from fdc2a7d to 243b36e Compare May 29, 2026 10:30
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@618

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@618

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@618

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@618

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@618

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@618

@prisma-next/extension-cipherstash

npm i https://pkg.pr.new/@prisma-next/extension-cipherstash@618

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@618

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@618

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@618

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@618

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@618

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@618

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@618

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@618

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@618

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@618

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@618

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@618

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@618

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@618

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@618

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@618

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@618

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@618

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@618

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@618

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@618

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@618

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@618

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@618

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@618

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@618

prisma-next

npm i https://pkg.pr.new/prisma-next@618

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@618

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@618

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@618

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@618

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@618

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@618

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@618

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@618

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@618

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@618

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@618

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@618

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@618

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@618

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@618

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@618

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@618

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@618

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@618

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@618

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@618

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@618

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@618

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@618

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@618

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@618

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@618

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@618

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@618

commit: 243b36e

@wmadden wmadden merged commit 9787be3 into main May 29, 2026
19 checks passed
@wmadden wmadden deleted the tml-2722-fix-example-emit-output-dir branch May 29, 2026 10:44
wmadden-electric added a commit that referenced this pull request May 30, 2026
…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>
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.

1 participant