Skip to content

feat: add create-prisma next support#37

Draft
AmanVarshney01 wants to merge 36 commits into
mainfrom
aman/create-prisma-next
Draft

feat: add create-prisma next support#37
AmanVarshney01 wants to merge 36 commits into
mainfrom
aman/create-prisma-next

Conversation

@AmanVarshney01
Copy link
Copy Markdown
Member

@AmanVarshney01 AmanVarshney01 commented May 11, 2026

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
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

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: 9abac048-9347-4052-ae74-8950683eac76

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
✨ 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 and usage tips.

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

github-actions Bot commented May 11, 2026

@next preview published

  • Version: 0.4.2-next.37.98.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/26224354825

AmanVarshney01 and others added 9 commits May 18, 2026 00:31
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>
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>
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.

2 participants