Skip to content

refactor: adopt the Prisma ORM composer API names - #72

Merged
wmadden-electric merged 2 commits into
mainfrom
rename/prisma-orm-composer-api
Aug 26, 2026
Merged

refactor: adopt the Prisma ORM composer API names#72
wmadden-electric merged 2 commits into
mainfrom
rename/prisma-orm-composer-api

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Follow-on to prisma/composer#265, which retires the pre-release "Prisma Next" naming in Composer.

Changes

  • Templates: import { pnPostgres } from "@prisma/composer-prisma-cloud/prisma-next"import { postgres } from "@prisma/composer-prisma-cloud/orm"; pnContract()dataContract().
  • Pins: @prisma/composer and @prisma/composer-prisma-cloud 0.14.0 → 0.16.0 (the release carrying the rename).
  • Internal: supportsPrismaNextsupportsPrisma.
  • Tests updated to match.

Deliberately unchanged

The Deno path keeps the prisma-next npm CLI (the ORM-only entrypoint) and its generated prisma-next.config.ts / prisma-next.md, per the existing comment in dependencies.ts — the consolidated prisma CLI is not yet Deno-compatible.

Merge order

⚠️ Merge only after composer 0.16.0 is published — the templates and pins reference it. Unit tests, typecheck, and lint pass locally; the e2e suite needs the published package.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f7f39acd-0bf5-4117-b4d3-4dfbcc9fdd7b

📥 Commits

Reviewing files that changed from the base of the PR and between dc3c99e and 1414303.

📒 Files selected for processing (12)
  • src/commands/create.ts
  • src/constants/dependencies.ts
  • src/tasks/install.ts
  • src/utils/node-version.ts
  • templates/create/_shared/module.ts.hbs
  • templates/create/_shared/service.ts.hbs
  • templates/create/_shared/src/prisma/composer.ts.hbs
  • templates/create/_shared/src/prisma/db.ts.hbs
  • tests/dependencies.test.ts
  • tests/e2e/create-prisma.e2e.test.ts
  • tests/install.test.ts
  • tests/node-version.test.ts

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting


Summary by CodeRabbit

  • New Features

    • Updated generated PostgreSQL projects to use the latest ORM APIs.
    • Added timestamp support for PostgreSQL projects through the generated setup.
    • Updated Prisma and Composer packages to the latest supported release.
  • Bug Fixes

    • Improved endpoint readiness checks during project verification by retrying until the service is available.
    • Updated Node.js compatibility checks for the current Prisma release.

Walkthrough

The PR renames the Prisma Node.js compatibility check to supportsPrisma. It updates Prisma and Composer package pins to Prisma 8.0.0-rc.12 and Composer 0.16.0. PostgreSQL templates now use postgres and dataContract. Non-Deno PostgreSQL projects add temporal-polyfill. Tests update expected output and retry Composer endpoint requests until they are ready.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename/prisma-orm-composer-api
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch rename/prisma-orm-composer-api

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

wmadden
wmadden previously approved these changes Aug 26, 2026
Composer 0.15.0 renames its ORM entrypoint (prisma/composer#265): the
`/prisma-next` subpath becomes `/orm`, `pnPostgres()` becomes `postgres()`,
and `pnContract()` becomes `dataContract()`. Update the scaffold templates
and pin composer 0.15.0; rename the internal `supportsPrismaNext` helper to
`supportsPrisma`.

The Deno path deliberately keeps the `prisma-next` npm CLI (ORM-only
entrypoint) and its generated `prisma-next.config.ts`/`prisma-next.md` until
the consolidated CLI is Deno-compatible — those references are unchanged.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Three fixes uncovered by the Composer-backed e2e test:

- The rc.8 query builder renamed .take() to .limit(); update the postgres branch of the users template.
- The rc.8 runtime generates timestamp defaults (instantNow) through the global Temporal object, which no stable Node or Bun ships. Without it the scaffolded app returns 500 on every request because the seed upsert cannot produce updatedAt. Add temporal-polyfill to postgres scaffolds and import temporal-polyfill/global in the db template.
- Composer 0.16.0 pins effect 4.0.0-rc.112 exactly; move the scaffold pin and overrides from rc.111 to match.

Also make the e2e endpoint probe retry: the dev CLI emits the endpoint frame before the app process has bound its port, and the first request can race the seed, so a single fetch was flaky.

The MIGRATION_PATH_NOT_FOUND failures seen while debugging were environmental, not a code bug: @prisma/dev persists database state per app name under ~/Library/Application Support/prisma-dev-nodejs/, so the always-named composer-app e2e database carried a schema marker stamped by an older toolchain that the rc.8 migration graph has no path from. A clean slate needs that directory removed along with ~/.prisma-composer/emulators.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@github-actions

Copy link
Copy Markdown

PR preview published

@wmadden-electric
wmadden-electric merged commit 3407abf into main Aug 26, 2026
5 of 6 checks passed
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.

2 participants