Repository navigation
fix(examples): generate each Prisma example's client into its own folder - #7806
Conversation
Co-authored-by: alexander <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure and use generated Prisma clients examples/next-prisma-starter/*, examples/next-prisma-todomvc/*, examples/next-prisma-websockets-starter/* |
Each project configures Prisma client output at ../generated/prisma, updates applicable seed and server imports to use the generated client, and ignores /generated/. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: 
Minimal · up to 582d8
-
No actionable merge-blocking risk introduced by this PR was established.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 7 files. (6 skipped: 6 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
trpc-bot
left a comment
There was a problem hiding this comment.
CI is green, including uncached lint for all three Prisma examples. LGTM.
Brings main up to db643ba: query handles and the live docs demos (#7759, #7817), the release commit check (#7834), the Prisma starter's generate step (#7806), the package links test (#7809), the sponsor cards (#7821, #7835), the PR template's AI model section (#7836) and v11.23.0. - v11/scripts/check-release-commit.ts names v11/lerna.json and v11/packages/* (git gives repo-root paths) and undoes from the repo root; v11/package.json takes its preversion and postversion scripts and its effect dependencies. - tanstack-react-query combines main's handles with #7767's feature flags: handles.ts reads keyPrefix through inferFeatureFlags, and Context.tsx passes the internal renderHandleVerbs flag through a variable. - main's live demos took the ```demo fence and the demo-slot class, so the kitchen sink's fence is ```kitchen-sink and its slot is kitchen-sink-slot. - www type-checks against v11's and v12's TanStack Query integrations, so v12's TanStack Query family moves to 5.105.0 with main. The react-spa cache test now persists through the transformer like the app, since 5.105.0 only falls back to initialPageParam for an undefined first cursor. - www/build/package-links.test.ts reads v11/packages. - turbo.json drops the Prisma starter's generate and lint entries. - The PR template keeps v12's and adds main's AI model section. - The lockfile is rebuilt from v12's, adding only the new dependencies. Co-authored-by: Alex / KATT <[email protected]>
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Why
mainfails inexamples/next-prisma-starter/src/pages/post/[id].tsx:Invalid type used in template literal expressionon${post.title}.@prisma/[email protected]. Each one'spostinstall(prisma generate) writes its client into that shared copy, so the last one to generate wins.Postmodel has notitle, so next-prisma-starter is type-checked against the wrong schema. feat(examples): next-prisma-starter on @shared/ui #7792's template-literal<title>was the first code to hit it. The merge-queue run only passed on a turbo cache hit.What
generator clientgetsoutput = "../generated/prisma", so each one generates into its owngenerated/prisma/folder at the example's root. The folder is gitignored.PrismaClient,PrismaandPostfrom that folder instead of@prisma/client:src/server/prisma.ts,src/server/routers/post.ts,prisma/seed.ts;src/server/prisma.ts,src/server/routers/post.ts,prisma/seed.ts;src/server/prisma.ts.@prisma/clientstays a dependency: the generated client loads its runtime from it.src/, because the websockets starter's server is compiled bytscintodist/, which doesn't copy the generated.js.../../generated/prismaresolves the same fromsrc/server/anddist/server/, andoxlint srcdoesn't scan it.Links
<title>broke lint; it loads through the example's own client.Alternatives considered
outputundersrc/generated/prisma. The websockets starter's production server (dist/server/*.js) would then requiredist/generated/prisma, whichtscnever writes.@prisma/clientviadependenciesMeta.injected. Ordering stays fragile, and injection changes the install for every Prisma example. A per-exampleoutputis what Prisma recommends and is the same inside and outside the monorepo.prisma-clientgenerator (ESM, TypeScript output). A bigger change to the runtime setup of three examples; not needed for this fix.Testing
pnpm install --frozen-lockfilewith scripts on, as in CI: all three examples generate their owngenerated/prisma/.pnpm turbo run lint typecheck --forcefor all three: 0 warnings and 0 errors;tsc --noEmitpasses for the websockets starter, which has notypecheckscript.--forceand a separate local Postgres database per example:test-dev,build,typecheckandtest-startpass for all three. The Playwright tests ran and passed, including the websockets starter's production server loading the client fromdist/server/.tooling/subtree's transform keeps theoutputline and thepostinstallgenerate step. Each copy installs withpnpm install --ignore-workspace, generates its client on install, andpnpm buildpasses.Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit