fix(local): resolve Prisma dev through the exported CLI manifest - #296
Conversation
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
|
✅ Gizmo reviewed e13cf19 — posted 0 inline comment(s) this pass. Open findings: none Change walkthroughThis PR fixes local Postgres dependency resolution for Prisma 8, which ships the Local-target resolver — postgres.ts keeps step 1 (resolve Error surface — the pinned "missing runtime" message in the resolver and the daemon's Tests — the module-resolution suite reuses its existing four cases: the fallback and missing-runtime fixtures now write the Prisma-8 manifest shape ( Docs and skill — running-locally.md and SKILL.md document the new dependency ownership ( |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (6)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Summary by CodeRabbit
WalkthroughLocal Postgres resolution now requires Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change preserves local Postgres resolution for app-owned and Prisma CLI-associated installations, with actionable guidance when the dependency is absent. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
commit: |
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
There was a problem hiding this comment.
New findings: 🟡 1 minor · trace
Findings outside the diff
- 🟡 Minor · consistency docs/design/10-domains/local-dev.md — local-dev spec's error-surface table still says to add
prisma, contradicting the corrected@prisma/devmessage
The PR corrects the user-facing message in both postgres.ts and postgres-main.ts to name@prisma/devas the project-owned dependency, and updates the guide and skill — but the local-dev spec's "Error surface" table (docs/design/10-domains/local-dev.md, line 260) still documents the old contract: row "no installedprismabin (the local-Postgres emulator)" says the error tells the user "what was searched for and to addprismato devDependencies". AGENTS.md treats the design docs as binding, and the resolver's own doc comment cites this spec ("local-dev spec § 4") as the pinning contract, so the spec of record now contradicts the shipped behavior and the dependency-ownership model this PR establishes.
Recommended fix: Update the row in docs/design/10-domains/local-dev.md to match the new contract, e.g. key it on@prisma/devbeing unresolvable (from the app or the CLI's exportedprisma/package.json) and say the error tells the user to add@prisma/devto the devDependencies of the project where Composer runs.
Fix
Fix the local Postgres resolver and tell users which dependency is actually missing.
prisma/package.json, not the JavaScript root. Prisma 8 has no root export, so the old lookup failed withERR_PACKAGE_PATH_NOT_EXPORTEDeven thoughprismawas installed.@prisma/devdependency as the first choice and retain the CLI-relative compatibility fallback for installations that supply the runtime there.@prisma/devto the devDependencies of the project where Composer runs. Correct the message in both the resolver and emulator daemon.Dependency ownership and related PRs
Prisma 8 does not include
@prisma/dev. The CLI design treats it as an optional, project-owned dependency. This PR does not change that ownership or install/download anything.prisma/create-prisma#102 adds the runtime to generated PostgreSQL projects, at the root for monorepos. That scaffolding fix works with the current published Composer release; this PR fixes the upstream fallback and error message independently.
Do not treat prisma/prisma-cli#270 as a prerequisite. That alternative packages the runtime into every CLI installation and is on hold. The earlier description requiring both PRs was based on an incorrect assumption about the v8 packaging design.
Verification
1c4db78d; no conflicts.prisma@8.0.0-rc.15and app Composer 0.19.0, both generated projects start local Postgres, apply migrations, and serve seeded users. Repeated HTTP requests retain the same three user IDs. No patched CLI or app source is needed.