Skip to content

feat: add Turborepo monorepo template - #79

Draft
AmanVarshney01 wants to merge 2 commits into
mainfrom
codex/add-turborepo-template
Draft

feat: add Turborepo monorepo template#79
AmanVarshney01 wants to merge 2 commits into
mainfrom
codex/add-turborepo-template

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • add a turborepo template, shown as Monorepo (Turborepo), with a Next.js app in apps/web and a shared Prisma package in packages/database
  • compose the existing Next.js template instead of duplicating it, and wire Composer to the nested app through appDir plus Next.js output tracing
  • generate Prisma contracts, runtime helpers, seed data, and migrations inside the database workspace
  • support npm, pnpm, Yarn, and Bun workspace dependency protocols
  • keep dependencies package-owned: the root owns the CLI, the database workspace owns its runtime polyfill, and generated apps do not depend on internal @prisma/dev
  • keep Composer commands at the workspace root instead of leaking invalid scripts into packages/database

Verification

  • bun run typecheck
  • bun run check
  • bun run test:unit — 42 passed
  • bun run build
  • manually scaffolded and built the template with npm, pnpm, and Bun
  • manually scaffolded and built the MongoDB variant with Bun
  • deployed a generated monorepo to Prisma Compute and verified seeded users at https://r2475ffy7ybu8li9rnj8zpr4.ewr.prisma.build
  • strict pnpm upstream smoke: packed the fixed CLI and Composer packages, scaffolded this template without direct @prisma/dev, built it, started compute and Postgres emulators, ran migrations, and verified seeded Alice/Bob/Carol over HTTP

Release dependency

Do not merge and release this template until both upstream fixes are merged and included in the versions consumed here:

Against the currently published packages, the Turborepo E2E correctly reproduces the upstream local dev needs @prisma/dev failure. Adding @prisma/dev directly to the template would hide the packaging bug and has intentionally been removed.

Notes

The generated standalone Next.js artifact reports relativeAppDir: "apps/web", so Composer packages the workspace-root dependencies and shared database package correctly.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

PR preview published

  • Version: 0.11.0-pr.79.273.1
  • Tag: pr79
  • Run with Bun: bunx create-prisma@pr79
  • Run with npm: npx create-prisma@pr79
  • Run with Yarn: yarn dlx create-prisma@pr79
  • Run with pnpm: pnpm dlx create-prisma@pr79
  • Run with Deno: deno run -A --minimum-dependency-age=0 npm:create-prisma@pr79
  • Workflow run: https://github.com/prisma/create-prisma/actions/runs/33096863585

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5eed0e4b-d0db-4e4c-b91f-6ce727e732b9

📥 Commits

Reviewing files that changed from the base of the PR and between d096cc2 and 4fa2fbe.

📒 Files selected for processing (4)
  • src/constants/dependencies.ts
  • src/tasks/install.ts
  • tests/dependencies.test.ts
  • tests/install.test.ts
💤 Files with no reviewable changes (2)
  • tests/dependencies.test.ts
  • src/constants/dependencies.ts

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


Summary by CodeRabbit

  • New Features

    • Added a Turborepo monorepo template for creating Prisma projects.
    • Includes a Next.js web app, shared database package, workspace configuration, and Turbo task setup.
    • Added template-specific Prisma paths, dependencies, scripts, and documentation.
    • Supports generating, building, type-checking, and running Turborepo projects.
  • Documentation

    • Updated project creation guidance for the consolidated Prisma CLI and Turborepo template.
  • Tests

    • Added coverage for Turborepo scaffolding, configuration, builds, dependencies, and runtime behavior.

Walkthrough

The CLI now offers a Turborepo template for Next.js monorepos with a shared Prisma database package. Generation supports template-specific Prisma paths, workspace packages, dependencies, Composer configuration, and Next.js deployment settings. New templates define Turborepo tasks, TypeScript configuration, package metadata, and ignore rules. Documentation and tests cover generated files, dependency versions, workspace configuration, builds, type checks, and Composer responses.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains the Turborepo template, its Next.js and Prisma workspace structure, package-manager support, Composer integration, verification, and release dependency.
Title check ✅ Passed The title concisely and accurately identifies the main change: adding a Turborepo monorepo template.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-turborepo-template
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/add-turborepo-template

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 27, 2026
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