Skip to content

Commit 90e7292

Browse files
calvinbrewerclaude
andcommitted
chore(prisma-example): upgrade the example app to Prisma Next 0.14
- deps: every @prisma-next/* pinned at 0.14.0 - prisma-next.config.ts: prismaContract takes the target PACK ref (@prisma-next/target-postgres/pack, carrying defaultNamespaceId) instead of the control descriptor - contract re-emitted in the 0.14 shape (public namespace, entries envelope, domain plane); migrations regenerated from scratch — fresh app initial migration + the cipherstash extension space re-materialised from the upgraded workspace package (head sha256:1e86a016…) - ORM/builder access namespace-qualified: db.orm.public.User, db.sql.public.users (src/index.ts + every e2e suite) - the CLI renamed 'migration apply' to 'migrate': package.json script, e2e global-setup, and READMEs updated (--yes for non-interactive runs) - e2e walkthrough test (e2e/tests/prisma-example-readme.e2e.test.ts): snapshot/restore examples/prisma/.env instead of deleting it in teardown — the old teardown destroyed a developer's real credentials file Full example e2e suite green against the docker harness: 36 passed, 1 skipped (known jsonbPathExists limitation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 35a49b0 commit 90e7292

30 files changed

Lines changed: 1565 additions & 2252 deletions

e2e/tests/prisma-example-readme.e2e.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,15 @@ function runStep(commandLine: string, timeoutMs: number): StepResult {
6262
}
6363
}
6464

65+
// `.env` is included so a developer's real credentials file survives the
66+
// walkthrough: the README's `cp .env.example .env` step overwrites it, and
67+
// without the snapshot the teardown would delete it outright. The snapshot
68+
// captures it before the run and the restore puts the original back.
6569
const TRANSIENT_PATHS = [
6670
'migrations/app',
6771
'src/prisma/contract.json',
6872
'src/prisma/contract.d.ts',
73+
'.env',
6974
] as const
7075

7176
async function snapshotTransientOutputs(): Promise<string> {
@@ -170,10 +175,11 @@ describe.skipIf(!authConfigured)(
170175
afterAll(async () => {
171176
// Teardown the bundled Postgres container regardless of outcome.
172177
runStep('docker compose down -v', 60_000)
173-
// Restore the transient outputs from snapshot so the working tree is clean.
178+
// Restore the transient outputs from snapshot so the working tree is
179+
// clean. `.env` is part of the snapshot: the walkthrough's
180+
// `cp .env.example .env` overwrote it, and the restore brings back the
181+
// developer's original (or removes the copy when none existed before).
174182
await restoreTransientOutputs(snapDir)
175-
// Remove the .env we copied in the walkthrough (not tracked anyway).
176-
rmSync(join(EXAMPLE_DIR, '.env'), { force: true })
177183
}, 120_000)
178184

179185
// Per-step exit-zero assertion, registered once per non-skipped README line.

examples/prisma/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ docker compose up -d
3333
pnpm install
3434
pnpm emit # PSL → contract.{json,d.ts}
3535
pnpm migration:plan --name initial
36-
pnpm migration:apply # installs EQL bundle + your app schema in one sweep
36+
pnpm migration:apply # installs EQL bundle + your app schema in one sweep (runs `prisma-next migrate`)
3737
pnpm start # runs the demo
3838
```
3939

0 commit comments

Comments
 (0)