Skip to content

feat: add Prisma Composer workflow - #53

Merged
AmanVarshney01 merged 19 commits into
aman/create-prisma-nextfrom
codex/next-composer
Aug 18, 2026
Merged

feat: add Prisma Composer workflow#53
AmanVarshney01 merged 19 commits into
aman/create-prisma-nextfrom
codex/next-composer

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • build Composer into every Prisma 8 template in the create-prisma@next channel
  • use the consolidated prisma@next CLI for ORM and Composer commands instead of the separate prisma-next binary or a pinned CLI RC
  • reduce setup to one deployment prompt, Deploy to Prisma now?, with Yes selected by default
  • provision Prisma Postgres through Composer and deploy every supported framework to Prisma Compute
  • keep starter data in one idempotent src/prisma/seed.ts, invoked on the first server-side database read through the Composer binding
  • remove the fake standalone db:seed workflow, starter-data.ts, and the direct dotenv dependency/imports
  • use definePrismaConfig for the consolidated top-level Prisma config
  • support npm, pnpm, Yarn, and Bun using each selected package manager's native execution command
  • use documented framework build artifacts, including SvelteKit's adapter-node output
  • add an early Node 22.18 compatibility check and an auth-aware, quiet deployment flow

Stacking

This PR is stacked on #37 and targets its aman/create-prisma-next branch. It intentionally changes only Prisma 8; it does not change the Prisma 7 create-prisma@latest channel.

Upstream status

  • prisma/prisma-cli#183, credential refresh before delegated Composer runs, is merged.
  • prisma/prisma-cli#184, structured delegated output, is merged.
  • prisma/composer#235, the temporary framework compatibility layer for Compute, is merged and released in Composer 0.7/0.8/0.9.
  • Composer 0.9 is now pinned; it includes the .js/extensionless-to-TypeScript relative-import resolver fixes from prisma/composer#238.
  • the consolidated CLI is now published as prisma@next; the tag currently resolves to 8.0.0-rc.5.

Two upstream release issues still block a truthful end-to-end verification of the current stack:

  1. prisma@next contract emit emits the contract and then exits with CLI.UNEXPECTED: validateContractDeps() passes the relative path ./src/prisma/package.json to Node's createRequire(), which requires an absolute path. This must be fixed in ORM toolchain; create-prisma does not work around it.
  2. prisma@next mounts ORM toolchain rc.3, while @prisma/composer-prisma-cloud@0.9.0 still has an exact @prisma/orm-postgres@8.0.0-rc.1 peer and its own ORM toolchain rc.1 dependency. Composer Cloud needs a release aligned with the consolidated CLI's ORM family.

prisma@next orm init also still emits the deprecated CLI-engine defineConfig name and adds dotenv. The templates correct those generated files to definePrismaConfig and Composer-owned runtime configuration; no deployment or contract-emission workaround is included.

Seeding behavior

Composer has no framework-wide composer seed command today. The templates therefore use the same temporary service-runtime pattern as Composer's examples:

  • src/prisma/seed.ts contains the starter rows and idempotent writes
  • the first server-side database read calls seed() through the hydrated Composer database binding
  • concurrent reads in one service process share one promise; a failed attempt can retry
  • PostgreSQL uses conflict-safe upserts
  • there is no standalone db:seed script, child process, URL probing, .prisma-composer state read, or direct production credential handling

Data that must be applied as part of deployment should be authored as a Prisma 8 data migration with an invariant rather than placed in this starter seed.

Verification

  • formatting, lint, typecheck, and 17/17 unit tests pass
  • all 144 template/provider/authoring/package-manager combinations render and pass structural assertions
  • the previous immutable preview, create-prisma@0.4.2-pr.53.198.1, generated, built, deployed, queried, and destroyed all nine TypeScript + PostgreSQL + Bun templates: 9/9 passed
  • the previous full framework matrix also verified Composer #235's Next.js, Astro, and SvelteKit fixes across both authoring styles and all four package managers
  • the current prisma@next clean-install E2E reaches contract emit and then fails on the upstream relative-createRequire() bug described above; the current stack is not claimed as end-to-end green
  • MongoDB remains structurally tested only because no real MongoDB URL was available for the live matrix

Temporary Composer compatibility

Composer #235 handles the current provider gaps without changing generated framework output:

  • Next.js preserves and safely archives native standalone symlinks, including pnpm layouts and long link targets
  • Astro traces the adapter-node runtime dependencies into the deploy artifact
  • SvelteKit continues to use @sveltejs/adapter-node; the temporary Compute bootstrap handles the Bun URL inspect incompatibility

These are temporary compatibility fixes. The future Alchemy Prisma provider should own framework packaging, after which this Composer compatibility layer can be removed. Deployment routing/readiness remains a platform responsibility.

Before merge

  1. Fix ORM toolchain's relative createRequire() failure and move prisma@next to the fixed release.
  2. Publish Composer Cloud against the same ORM/toolchain family used by prisma@next.
  3. Rerun the complete 9-framework × 2-authoring-style × 4-package-manager live matrix using the moving prisma@next tag.

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e4323069-cfb5-4487-9896-44dd4f2f3bd0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

PR preview published

  • Version: 0.4.2-pr.53.201.1
  • Tag: pr53
  • Run with Bun: bunx create-prisma@pr53
  • Run with npm: npx create-prisma@pr53
  • Run with Yarn: yarn dlx create-prisma@pr53
  • Run with pnpm: pnpm dlx create-prisma@pr53
  • Run with Deno: deno run -A npm:create-prisma@pr53
  • Workflow run: https://github.com/prisma/create-prisma/actions/runs/32152338895

Write emitted contract JSON and types to a generated directory so TypeScript does not resolve contract.d.ts to the adjacent contract.ts source file.

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Use the aligned RC2 package for init, authentication, and Composer commands so package-manager tag caches cannot resolve an older CLI without the ORM command.

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Keep SvelteKit on adapter-node while asking Vite to inline the
application runtime packages required by the self-contained Composer
build artifact.

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Use Vite noExternal for the full server dependency graph so the
adapter-node build is self-contained for Composer.

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
@AmanVarshney01
AmanVarshney01 marked this pull request as ready for review August 18, 2026 15:05
@AmanVarshney01
AmanVarshney01 merged commit 1520c3e into aman/create-prisma-next Aug 18, 2026
5 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.

1 participant