Skip to content

feat: add Prisma 8 support - #37

Merged
AmanVarshney01 merged 47 commits into
mainfrom
aman/create-prisma-next
Aug 21, 2026
Merged

feat: add Prisma 8 support#37
AmanVarshney01 merged 47 commits into
mainfrom
aman/create-prisma-next

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds the Prisma Next create flow using prisma-next@latest init --no-install as the source of truth for Prisma Next files and starter contracts.
  • Supports PostgreSQL and MongoDB across minimal, hono, elysia, nest, next, svelte, astro, nuxt, and tanstack-start.
  • Makes minimal the default template and adds per-template descriptions in the interactive picker.
  • Supports PSL and TypeScript contract authoring, with PostgreSQL defaulting to Prisma Postgres in interactive mode and --yes staying non-provisioning.
  • Keeps db:init, migrations, and seed manual only. No generated path auto-runs database setup under prompts or --yes.
  • Resolves Prisma Next packages from latest at scaffold time instead of hard-pinning framework versions in create-prisma.
  • Installs Prisma Next packages, provider runtime packages, generated contract/type packages, and the Vite contract emit plugin where relevant.
  • Removes create-prisma ownership of Prisma Next skills sync: no @prisma-next/agent-skill, no skills dependency, no skills:sync script, and no experimental_sync invocation.
  • Adds MongoDB Docker Compose helpers for default local MongoDB projects.
  • Removes the turborepo template from the Prisma Next create path.
  • Simplifies the Clack completion output and adds an agent prompt pointing users to prisma-next.md and the upstream Prisma Next skills/ directory.
  • Adds Prisma Next-specific telemetry event names, scoped to create-prisma@next releases.

Validation

  • bun run format:check
  • bun run typecheck
  • bun run lint
  • bun run build
  • bun run test:unit
  • bun run test:e2e
  • Full Minimal Postgres flow: install, emit, db:init, db:verify, migration plan/apply, seed, and query script.
  • Full Minimal MongoDB flow: install, emit, migration plan/apply, seed, and query script.
  • Existing e2e covers Hono Postgres and Hono MongoDB through migrations, seed, generated queries, and build.
  • Package-manager smoke for bun, npm, pnpm, and deno verifies generated Minimal projects do not include skills, @prisma-next/agent-skill, or skills:sync.

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 159 files, which is 9 over the limit of 150.

To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to Pro+ to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cf8ed732-515f-4207-ab40-4cfee61e15ed

📥 Commits

Reviewing files that changed from the base of the PR and between a917311 and 0be6e74.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (159)
  • .github/workflows/publish.yml
  • .gitignore
  • README.md
  • package.json
  • src/cli.ts
  • src/commands/create.ts
  • src/constants/db-packages.ts
  • src/constants/dependencies.ts
  • src/index.ts
  • src/tasks/deploy-to-compute.ts
  • src/tasks/deploy-with-composer.ts
  • src/tasks/install.ts
  • src/tasks/prisma-postgres.ts
  • src/tasks/setup-addons.ts
  • src/tasks/setup-prisma.ts
  • src/telemetry/create.ts
  • src/templates/render-create-template.ts
  • src/templates/shared.ts
  • src/types.ts
  • src/ui/branding.ts
  • src/utils/node-version.ts
  • src/utils/package-manager.ts
  • src/utils/regexp.ts
  • src/utils/runtime.ts
  • templates/create/_shared/.gitattributes.hbs
  • templates/create/_shared/README.md.hbs
  • templates/create/_shared/module.ts.hbs
  • templates/create/_shared/pnpm-workspace.yaml.hbs
  • templates/create/_shared/prisma-composer.config.ts.hbs
  • templates/create/_shared/prisma.config.ts.hbs
  • templates/create/_shared/service.ts.hbs
  • templates/create/_shared/src/prisma/composer.ts.hbs
  • templates/create/_shared/src/prisma/db.ts.hbs
  • templates/create/_shared/src/prisma/seed.ts.hbs
  • templates/create/_shared/src/prisma/users.ts.hbs
  • templates/create/astro/README.md.hbs
  • templates/create/astro/astro.config.mjs
  • templates/create/astro/astro.config.mjs.hbs
  • templates/create/astro/deno.json.hbs
  • templates/create/astro/package.json.hbs
  • templates/create/astro/prisma.compute.ts.hbs
  • templates/create/astro/prisma.config.ts.hbs
  • templates/create/astro/prisma/schema.prisma.hbs
  • templates/create/astro/prisma/seed.ts.hbs
  • templates/create/astro/src/lib/prisma.ts.hbs
  • templates/create/astro/src/pages/api/users.ts.hbs
  • templates/create/astro/src/pages/index.astro.hbs
  • templates/create/astro/tsconfig.json
  • templates/create/elysia/README.md.hbs
  • templates/create/elysia/deno.json.hbs
  • templates/create/elysia/package.json.hbs
  • templates/create/elysia/prisma.compute.ts.hbs
  • templates/create/elysia/prisma.config.ts.hbs
  • templates/create/elysia/prisma/schema.prisma.hbs
  • templates/create/elysia/prisma/seed.ts.hbs
  • templates/create/elysia/src/index.ts.hbs
  • templates/create/elysia/src/lib/prisma.ts.hbs
  • templates/create/elysia/tsconfig.json
  • templates/create/hono/README.md.hbs
  • templates/create/hono/deno.json.hbs
  • templates/create/hono/package.json.hbs
  • templates/create/hono/prisma.compute.ts.hbs
  • templates/create/hono/prisma.config.ts.hbs
  • templates/create/hono/prisma/schema.prisma.hbs
  • templates/create/hono/prisma/seed.ts.hbs
  • templates/create/hono/src/index.ts.hbs
  • templates/create/hono/src/lib/prisma.ts.hbs
  • templates/create/hono/tsconfig.json
  • templates/create/minimal/.gitignore
  • templates/create/minimal/.yarnrc.yml.hbs
  • templates/create/minimal/package.json.hbs
  • templates/create/minimal/src/index.ts.hbs
  • templates/create/minimal/tsconfig.json
  • templates/create/nest/README.md.hbs
  • templates/create/nest/deno.json.hbs
  • templates/create/nest/package.json.hbs
  • templates/create/nest/prisma.compute.ts.hbs
  • templates/create/nest/prisma.config.ts.hbs
  • templates/create/nest/prisma/schema.prisma.hbs
  • templates/create/nest/prisma/seed.ts.hbs
  • templates/create/nest/src/app.module.ts.hbs
  • templates/create/nest/src/lib/prisma.ts.hbs
  • templates/create/nest/src/main.ts.hbs
  • templates/create/nest/src/prisma.service.ts.hbs
  • templates/create/nest/src/users.controller.ts.hbs
  • templates/create/nest/src/users.service.ts.hbs
  • templates/create/nest/tsconfig.json
  • templates/create/next/README.md.hbs
  • templates/create/next/deno.json.hbs
  • templates/create/next/eslint.config.mjs
  • templates/create/next/next.config.ts
  • templates/create/next/package.json.hbs
  • templates/create/next/prisma.compute.ts.hbs
  • templates/create/next/prisma.config.ts.hbs
  • templates/create/next/prisma/schema.prisma.hbs
  • templates/create/next/prisma/seed.ts.hbs
  • templates/create/next/src/app/page.tsx.hbs
  • templates/create/next/src/lib/prisma.ts.hbs
  • templates/create/next/tsconfig.json
  • templates/create/nuxt/README.md.hbs
  • templates/create/nuxt/app/pages/index.vue.hbs
  • templates/create/nuxt/deno.json.hbs
  • templates/create/nuxt/package.json.hbs
  • templates/create/nuxt/prisma.compute.ts.hbs
  • templates/create/nuxt/prisma.config.ts.hbs
  • templates/create/nuxt/prisma/schema.prisma.hbs
  • templates/create/nuxt/prisma/seed.ts.hbs
  • templates/create/nuxt/server/api/users.get.ts.hbs
  • templates/create/nuxt/server/utils/prisma.ts.hbs
  • templates/create/nuxt/tsconfig.json
  • templates/create/svelte/.npmrc
  • templates/create/svelte/README.md.hbs
  • templates/create/svelte/deno.json.hbs
  • templates/create/svelte/package.json.hbs
  • templates/create/svelte/prisma.config.ts.hbs
  • templates/create/svelte/prisma/schema.prisma.hbs
  • templates/create/svelte/prisma/seed.ts.hbs
  • templates/create/svelte/src/lib/server/prisma.ts.hbs
  • templates/create/svelte/src/routes/+page.server.ts.hbs
  • templates/create/svelte/src/routes/+page.svelte.hbs
  • templates/create/svelte/svelte.config.js
  • templates/create/svelte/tsconfig.json
  • templates/create/svelte/vite.config.ts
  • templates/create/tanstack-start/README.md.hbs
  • templates/create/tanstack-start/deno.json.hbs
  • templates/create/tanstack-start/package.json.hbs
  • templates/create/tanstack-start/prisma.compute.ts.hbs
  • templates/create/tanstack-start/prisma.config.ts.hbs
  • templates/create/tanstack-start/prisma/schema.prisma.hbs
  • templates/create/tanstack-start/prisma/seed.ts.hbs
  • templates/create/tanstack-start/src/lib/prisma.server.ts.hbs
  • templates/create/tanstack-start/src/routes/__root.tsx.hbs
  • templates/create/tanstack-start/src/routes/index.tsx.hbs
  • templates/create/tanstack-start/tsconfig.json
  • templates/create/tanstack-start/vite.config.ts
  • templates/create/turborepo/.gitignore
  • templates/create/turborepo/README.md.hbs
  • templates/create/turborepo/apps/api/package.json.hbs
  • templates/create/turborepo/apps/api/src/index.ts.hbs
  • templates/create/turborepo/deno.json.hbs
  • templates/create/turborepo/package.json.hbs
  • templates/create/turborepo/packages/db/package.json.hbs
  • templates/create/turborepo/packages/db/prisma.config.ts.hbs
  • templates/create/turborepo/packages/db/prisma/schema.prisma.hbs
  • templates/create/turborepo/packages/db/prisma/seed.ts.hbs
  • templates/create/turborepo/packages/db/src/client.ts.hbs
  • templates/create/turborepo/packages/db/src/index.ts
  • templates/create/turborepo/packages/db/tsconfig.json
  • templates/create/turborepo/pnpm-workspace.yaml
  • templates/create/turborepo/prisma.compute.ts.hbs
  • templates/create/turborepo/turbo.json
  • tests/dependencies.test.ts
  • tests/deploy-with-composer.test.ts
  • tests/e2e/create-prisma.e2e.test.ts
  • tests/install.test.ts
  • tests/node-version.test.ts
  • tests/setup-prisma.test.ts
  • tests/telemetry.test.ts
  • tsdown.config.ts

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/create-prisma-next
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/create-prisma-next

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

@AmanVarshney01 AmanVarshney01 added the release:next Publish this PR preview to the npm next dist-tag label May 11, 2026
@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown

@next preview published

  • Version: 0.4.2-next.37.214.1
  • Tag: next
  • Trigger: PR has the release:next label, so this is available as create-prisma@next
  • Run with Bun: bunx create-prisma@next
  • Run with npm: npx create-prisma@next
  • Run with Yarn: yarn dlx create-prisma@next
  • Run with pnpm: pnpm dlx create-prisma@next
  • Run with Deno: deno run -A npm:create-prisma@next
  • Workflow run: https://github.com/prisma/create-prisma/actions/runs/32486275037

AmanVarshney01 and others added 11 commits May 18, 2026 14:59
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>
* feat: use mongodb-memory-server for local mongo dev

Replace the docker-compose helper with a generated scripts/start-mongo.ts
that runs mongodb-memory-server, so `db:up` works without Docker. When
mongo is selected without --database-url, the helper now writes the
start script, pins mongodb-memory-server@^11.1.0 as a devDependency,
and sets a package-manager-aware `db:up` script
(bun / deno run -A / tsx). No more docker-compose.yml, no db:down.

The e2e suite is parameterized across hono + next for both providers
(4 tests). Mongo cases scaffold without a databaseUrl, start the
generated db:up in the background on a free port, and exercise
migrate / seed / verify / build against the in-memory server — so the
generated script is itself under test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: persist mongo dev data across db:up restarts

The generated scripts/start-mongo.ts now writes the replica set's data
to a real directory (default .mongo-data/, overridable via MONGO_DB_PATH)
instead of mongodb-memory-server's temp dir, so seeded users and
applied migrations survive between Ctrl+C cycles. The setup helper
gitignores .mongo-data, and each template README explains the
"delete the folder for a clean slate" escape hatch.

E2E tests stay ephemeral by construction: each test scaffolds a fresh
project, so its .mongo-data is a fresh directory too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: detach db:up and add db:down + db:reset

Replace scripts/start-mongo.ts with a scripts/mongo.ts CLI that exposes
three subcommands: up (detached child that exits once the replica set
prints "ready", PID written to .mongo-data/mongo.pid, logs in
.mongo-data/mongo.log), down (SIGTERM the recorded PID, SIGKILL after
10s, idempotent on stale PIDs), and reset (down plus wipe of
.mongo-data/). The CLI re-exec's itself with the right runner — bun,
deno run -A, or tsx — so it stays correct across the package managers
we ship.

Cleanup is now an obvious one-liner: db:reset stops mongo and removes
the data directory. db:down leaves data in place.

The e2e suite is correspondingly simpler: the test just calls
`bun run db:up` (returns when ready, MONGO_PORT passed in for
collision-free parallelism) and `bun run db:down` in the finally, with
no in-test background process management.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: harden local mongo scaffold

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

* fix: clean up mongo helper data paths

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

---------

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
* refactor: model Prisma Next version as a resolved spec

Introduce ResolvedPrismaNextSpec + parsePrismaNextVersionSpec so the
target Prisma Next version is no longer a module-level constant. The
parser recognises pkg-pr-new:<ref> specs alongside npm versions and
dist-tags; getPrismaNextPackageSpecifier and getDependencyVersion now
accept the resolved spec and emit either name@<spec> or the
https://pkg.pr.new/prisma/prisma-next/<name>@<ref> URL form that
package managers accept directly.

No call sites pass a non-default spec yet; the new shape is what the
upcoming --prisma-next-version flag will thread through.

* feat: thread --prisma-next-version through scaffolding

Add the --prisma-next-version flag and plumb the resolved Prisma Next
spec into PrismaSetupContext, writePrismaDependencies,
writeCreateTemplateDependencies, and the prisma-next init invocation.
Every @prisma-next/* and prisma-next dependency written into
package.json — and the npx/dlx/bunx prisma-next@<spec> init command —
now honours the spec. With no flag, behaviour is unchanged (latest).

Supported specs:
- a published npm version (0.10.0, 0.11.0-dev.9, …) for regression /
  bisect work against the exact version a user filed an issue on;
- an npm dist-tag (latest, dev, next, …) for smoke-testing release
  candidates before they get the latest tag;
- pkg-pr-new:<sha|branch|pr-number> for dogfooding open PRs end-to-end
  through the canonical scaffold path — substitutes the
  https://pkg.pr.new/prisma/prisma-next/<package>@<ref> URL specifier
  for every Prisma Next install. Package managers accept URL specifiers
  in both install argv and package.json, so no special-casing per
  package manager is needed.

The pkg.pr.new path doesn't yet derive a matching skills ref (the
upstream prisma-next CLI needs a PRISMA_NEXT_SKILLS_REF override before
this is fully wired up); cases 1+2 work end-to-end today and unblock
the onboarding-audit regression workflows.

* feat: report Prisma Next version spec in create telemetry

Add prisma-next-version-kind (default | npm-tag | npm-version |
pkg-pr-new) and prisma-next-version-spec to the create command's
completion / failure events. The kind is the low-cardinality signal
the onboarding audit needs to see which escape hatch users reach for;
the spec round-trips the exact string for the long tail of dist-tags,
prereleases, and PR refs that can't be summarised by the kind alone.
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

Copy link
Copy Markdown
Member Author

Updated in fca2dac.

What changed

  • Aligned generated PostgreSQL code with the current Prisma Next namespace: db.orm.public.User.
  • Replaced the removed createCount usage with the current single-row .create(...) API.
  • Updated database shutdown paths to use await db.close().
  • Raised the required Node.js version to 24 and aligned generated TypeScript dependencies with the Prisma Next 5.9 minimum.
  • Added the missing vue-tsc dependency for Nuxt typechecking.
  • Excluded generated migrations and Prisma declaration files from Next.js linting.
  • Added --no-skill to prisma-next init so scaffolding remains template-driven.
  • Updated Mongo helper documentation with its Node.js 24+ requirement.
  • Replaced the deprecated tsdown inlineOnly option.
  • Expanded template rendering tests to all 180 combinations: 9 templates × 2 providers × 2 authoring modes × 5 package managers.
  • Expanded live E2E coverage to all templates and both PSL/TypeScript contracts, including real installs, database lifecycle, migrations, seeds, generated queries, and framework build/typecheck/lint validation.

Verification

  • Audited directly against prisma/prisma-next main at e0e739ca6a0e076c97733ef30ec3bf7b1f43a27b.
  • Prisma Next latest (0.16.0): 36/36 live Node/npm template combinations passed.
  • Prisma Next dev (0.16.0-dev.34): 37/37 tests passed, including positional project-name behavior.
  • Unit suite: 37 passed with 1,175 assertions.
  • Typecheck, formatting, lint, build, and git diff --check all pass.

Upstream runtime limitation

Bun 1.3.14 + Mongo remains blocked upstream because BSON calls node:v8.startupSnapshot.isBuildingSnapshot(), which Bun currently throws as ERR_NOT_IMPLEMENTED. No Node fallback, BSON pin, shim, or other workaround is retained. Mongo passes across all templates on the supported Node.js 24/npm path.

* feat: add Prisma Composer workflow

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

* fix: update tsdown dependency warning config

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

* fix: isolate generated TypeScript contract artifacts

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>

* fix: pin the Prisma platform CLI prerelease

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>

* fix: show deployed app URL

* fix: expose Elysia on Compute

* fix: select the Elysia runtime adapter

* fix: address deploy matrix failures

* fix: align Composer framework dependencies

* fix: bundle SvelteKit runtime dependencies

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>

* fix: inline all SvelteKit SSR dependencies

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>

* fix: default immediate deployment to yes

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

* chore: call the release Prisma 8

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

* fix: consume released framework deployment fixes

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

* fix: connect and seed starter databases

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

* fix: keep seeding on public Composer bindings

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

* fix: seed through Composer service runtime

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

* refactor: align Prisma 8 templates with consolidated CLI

* chore: update Composer packages to 0.9

---------

Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
@AmanVarshney01 AmanVarshney01 added release:next Publish this PR preview to the npm next dist-tag and removed release:next Publish this PR preview to the npm next dist-tag labels Aug 18, 2026
@AmanVarshney01
AmanVarshney01 marked this pull request as ready for review August 18, 2026 15:09
@AmanVarshney01
AmanVarshney01 marked this pull request as draft August 18, 2026 15:10
@AmanVarshney01
AmanVarshney01 marked this pull request as ready for review August 21, 2026 13:19
@AmanVarshney01 AmanVarshney01 changed the title feat: add create-prisma next support feat: add Prisma 8 support Aug 21, 2026
@AmanVarshney01
AmanVarshney01 requested a review from wmadden August 21, 2026 13:20
@AmanVarshney01

Copy link
Copy Markdown
Member Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@AmanVarshney01
AmanVarshney01 merged commit 0b16a0d into main Aug 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:next Publish this PR preview to the npm next dist-tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants