Skip to content

feat: add Prisma Composer workflow - #53

Draft
AmanVarshney01 wants to merge 11 commits into
aman/create-prisma-nextfrom
codex/next-composer
Draft

feat: add Prisma Composer workflow#53
AmanVarshney01 wants to merge 11 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 create-prisma@next template and initialize ORM through the consolidated Prisma CLI
  • reduce setup to one deployment prompt: Deploy to Prisma now?
  • provision Prisma Postgres through the native Composer provider, run migrations/seed during immediate deployment, and generate a typed runtime client
  • support npm, pnpm, Yarn, and Bun using each selected package manager's native commands
  • use documented framework build artifacts; SvelteKit uses Vite's supported SSR inlining to produce a self-contained adapter-node build
  • add an early Node 22.18 compatibility check and an auth-aware, quiet deployment flow
  • return a non-zero process status when setup/deployment fails while retaining the generated project

Stacking

This PR is stacked on #37 and targets its aman/create-prisma-next branch. It does not modify #37 and should be rebased or retargeted after #37 lands.

This intentionally focuses on create-prisma@next. It does not add a Prisma 7 or create-prisma@latest compatibility path.

Verification

  • formatting, lint, typecheck, package build, and 20/20 tests pass
  • all 144 template/provider/authoring/package-manager combinations render and pass structural assertions
  • immutable full-matrix preview: create-prisma@0.4.2-pr.53.190.1
  • immutable SvelteKit artifact-fix preview: create-prisma@0.4.2-pr.53.191.1
  • 72/72 PostgreSQL combinations exercised through the actual public npm, pnpm, Yarn, or Bun CLI command
  • every passing deployment's printed .prisma.build URL was requested and required to execute a real database query before the deployment and database were destroyed
  • final live matrix: 48 passed, 24 failed
Template npm pnpm Yarn Bun Result
Minimal 2/2 2/2 2/2 2/2 8/8 pass
Hono 2/2 2/2 2/2 2/2 8/8 pass
Elysia 2/2 2/2 2/2 2/2 8/8 pass
NestJS 2/2 2/2 2/2 2/2 8/8 pass
Nuxt 2/2 2/2 2/2 2/2 8/8 pass
TanStack Start 2/2 2/2 2/2 2/2 8/8 pass
Next.js 0/2 0/2 0/2 0/2 8/8 blocked by current Composer packaging
SvelteKit 0/2 0/2 0/2 0/2 8/8 blocked by the current Compute Bun runtime
Astro 0/2 0/2 0/2 0/2 8/8 blocked by current Composer packaging

Each 2/2 covers PSL and TypeScript contract authoring. The SvelteKit row was rerun on preview 191.1 after the artifact fix: all 8 public CLI flows installed, built, deployed, reached the live URL, reproduced the same runtime failure, and destroyed cleanly.

The generated SvelteKit artifacts are 5.7–5.9 MiB, contain no symlinks, and contain no bare Prisma/Composer/Arktype/dotenv/MongoDB imports. A final Platform audit found no remaining pr53-* test Projects.

Currently verified with @prisma/cli 8.0.0-rc.2, Prisma Next ORM 8.0.0-rc.1, Composer 0.6.0-dev.18, and Node 22.23.2.

Current Composer/provider boundaries

  • Next.js: all package managers produce standalone output containing dependency symlinks. Current generic Composer rejects symlinks because deploy bundles must be flat. The official Alchemy Prisma provider already has a Next-specific staging strategy, so this is expected to move out of create-prisma after migration, but it still needs end-to-end verification.
  • Astro: all combinations install and build, but current generic Composer deploys return a missing-service 404. Astro's server output needs dependency-aware staging. The official provider has an Astro-specific strategy, so migration is expected to fix this, subject to live verification.
  • SvelteKit artifact: fixed in this PR with Vite ssr.noExternal while keeping the official adapter-node. Composer receives the explicit self-contained build/ directory; there is no copied node_modules, post-build bundler, or Composer special case.
  • SvelteKit runtime: still blocked. Compute currently starts Bun 1.4.0 (Node compatibility 26.3.0), where adding Symbol.for("nodejs.util.inspect.custom") to a URL returns read-only. Latest SvelteKit 2.70.2 performs that operation in make_trackable, so every SSR request returns 500. The identical build works on local Bun 1.3.14. Switching Composer to Alchemy's official Prisma resource provider alone does not fix this because it uploads to the same Compute runtime and exposes no Node/Bun runtime selector. This needs a Compute Bun fix or a supported Node runtime.
  • Readiness: the current deployment path may report success before the application process proves reachable. Template fixes avoid this for the six passing frameworks, but provider/runtime readiness should still be verified during migration.
  • Auth handoff: Composer commands reject an OAuth session near expiry because child processes cannot refresh it. Re-authentication resolves it; this belongs to the consolidated CLI/auth handoff rather than create-prisma.

No hoisting, symlink flattening, copied node_modules, post-build bundler, or artifact-rewriting workaround is included.

Other limitations

  • MongoDB remains an external MONGODB_URL; no real Mongo URL was available for live deployment, so its 72 combinations are structurally tested only.
  • Composer currently requires an app-local alchemy executable. The templates retain that dependency and align Vite-based frameworks with Alchemy's Vite 8 peer contract.
  • prisma-next rc.1 currently advertises Node 24 even though the consolidated CLI and Composer support Node 22.18. This branch follows the agreed Node 22.18 minimum while prerelease package metadata is still moving.

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: 380b26b6-31c1-49d8-bc93-fc31ba574ebf

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.192.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/31802161975

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>
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