Skip to content

fix(prisma-cloud): carry the effect platform packages the alchemy CLI requires#151

Merged
wmadden merged 2 commits into
mainfrom
claude/alchemy-effect-platform-deps
Jul 22, 2026
Merged

fix(prisma-cloud): carry the effect platform packages the alchemy CLI requires#151
wmadden merged 2 commits into
mainfrom
claude/alchemy-effect-platform-deps

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

A standalone install of an app that depends on @prisma/composer-prisma-cloud cannot run prisma-composer deploy: the alchemy CLI's command tree imports the Cloudflare provider namespace and alchemy's platform services at load time, which require @effect/platform-node and @effect/platform-bun — but alchemy declares both as optional peerDependencies, so package managers skip them. The deploy dies before planning anything:

Cannot find module '@effect/platform-node/NodeServices' from
'…/node_modules/alchemy/src/Cloudflare/Workers/WorkerBridge.ts'

then, once that package is supplied, the @effect/platform-bun/BunRuntime twin from alchemy's Util/PlatformServices.ts.

This workspace never sees the failure (pnpm resolves the optional peers into its own tree), and an app developed inside a checkout inherits them via parent-directory module resolution — only a genuinely standalone install hits it, which is exactly the consumer this package exists for. Surfaced by the open-chat port (prisma/open-chat#1, its FRICTION.md #11), which had to declare both packages as app devDependencies to deploy at all.

Since this package pins alchemy exactly and always drives its CLI, alchemy's "optional" peers are mandatory for every consumer — so this package carries them as real dependencies, pinned to the versions the workspace already resolves (@effect/platform-node@4.0.0-beta.92, @effect/platform-bun@4.0.0-beta.97). The alternative fix — alchemy lazy-importing provider namespaces so unused providers' peers stay truly optional — is upstream's to make; this closes the gap for our consumers now.

After this lands, the open-chat port can drop the two @effect/* devDependencies it added as a workaround.

🤖 Generated with Claude Code

… requires

The deploy path runs the alchemy CLI, whose command tree imports the
Cloudflare provider namespace and platform services at load time —
requiring @effect/platform-node and @effect/platform-bun. alchemy
declares both as optional peerDependencies, so a package-manager install
of an app depending only on @prisma/composer-prisma-cloud never installs
them, and prisma-composer deploy dies before planning anything:

  Cannot find module "@effect/platform-node/NodeServices" from
  ".../node_modules/alchemy/src/Cloudflare/Workers/WorkerBridge.ts"

(then the @effect/platform-bun/BunRuntime twin from Util/PlatformServices).
This workspace never sees the failure because pnpm resolves the optional
peers into its own tree, and any app developed inside a checkout inherits
them through parent-directory module resolution — only a standalone
install hits it, which is exactly the consumer this package is for.
Surfaced by the open-chat port (its FRICTION.md #11), which had to declare
both packages as app devDependencies to deploy at all.

Declaring them as real dependencies here puts the knowledge where it
belongs: this package pins alchemy exactly and always drives its CLI, so
alchemy's "optional" peers are, for every consumer of this package,
mandatory. Versions are the ones the workspace already resolves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@wmadden-electric, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 30638731-073a-4a66-8eb3-2ecd3602f6f8

📥 Commits

Reviewing files that changed from the base of the PR and between db18909 and eb6701c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/9-public/composer-prisma-cloud/package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/alchemy-effect-platform-deps
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/alchemy-effect-platform-deps

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.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@prisma/composer@151
npm i https://pkg.pr.new/@prisma/composer-prisma-cloud@151

commit: eb6701c

@wmadden
wmadden enabled auto-merge (rebase) July 22, 2026 14:10
@wmadden
wmadden merged commit c26200b into main Jul 22, 2026
14 checks passed
@wmadden
wmadden deleted the claude/alchemy-effect-platform-deps branch July 22, 2026 14:17
wmadden-electric added a commit to prisma/open-chat that referenced this pull request Jul 22, 2026
…6 (D6)

Flip the database edge from plain postgres() to the contract-carrying
pnPostgres: the resource is pnPostgres({ name: "database", contract,
config }) and the service consumes pnPostgres(chatData), so the deploy
migrates the freshly provisioned database itself (a PrismaNext.Migration
resource, [database-migrate] in the plan) before the chat service starts.
The launcher reads only db.url from the { url, client } binding
(prisma/composer#154, ADR-0040) — open-chat keeps its own pg.Pool shared
with Better Auth, and the framework-built typed client is never
constructed. FRICTION.md #12's by-hand schema step is gone.

The app toolchain moves to @prisma-next 0.15 (the version the framework
bundles): contract re-emitted, migrations store regenerated as
migrations/app/20260722T1415_init/ (from: null to the re-emitted
contract's hash; the 0.13-vintage refs are deleted). Two mechanical
consequences in app code: regenerated src/prisma/contract.{json,d.ts},
and the 0.15 runtime's schema-namespaced ORM paths (db.orm.<Model> →
db.orm.public.<Model>, 32 call sites, no behavioral change).

Composer packages pin npm 0.2.0-dev.6. The @effect/platform-* dev
dependencies added as a deploy workaround are removed —
@prisma/composer-prisma-cloud carries them itself since
prisma/composer#151 (FRICTION.md #11). New FRICTION.md #13 records a bun
resolver failure when two pkg.pr.new previews reference each other,
hit while proving against the PR preview and moot on npm pins.

Deployed fresh (destroy + deploy, zero manual steps) and verified end to
end on the deploy-reported URL: [database-migrate] ran in the deploy;
shell + client asset 200; guest sign-in 200 against the brand-new
database with no schema step ever run; chat create 201 with the row in
Postgres; SSE tail ready + 4 heartbeats over ~22s; Stripe webhook 400
unsigned / 400 bad-signature / 405 GET; message generation stops at
OpenRouter's auth boundary with the placeholder key. Local dev loop
re-verified on the npm pin (shell + sign-in 200).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
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.

2 participants